diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..b4a4798 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,9 @@ +## Description + + + + +## PR Checklist + +- [ ] I've added tests any code changes +- [ ] I've documented any new features diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..58a1dde --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,48 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of +fostering an open and welcoming community, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating +documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, such as physical or electronic + addresses, without explicit permission +* Other unethical or unprofessional conduct + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +By adopting this Code of Conduct, project maintainers commit themselves to +fairly and consistently applying these principles to every aspect of managing +this project. Project maintainers who do not follow or enforce the Code of +Conduct may be permanently removed from the project team. + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting a project maintainer at pook@sarayourfriend.pictures. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. Maintainers are +obligated to maintain confidentiality with regard to the reporter of an +incident. + + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.3.0, available at https://www.contributor-covenant.org/version/1/3/0/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..cc42bf1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,59 @@ +# Pook development + +**All contributors are obliged to follow Pook's [Code of Conduct](./CODE_OF_CONDUCT.md)**. + +## Getting started + +First, clone the repository: + +```bash +git clone git@github.com:h2non/pook.git +``` + +Pook uses [`hatch`](https://hatch.pypa.io/) for script and environment management. Run the `ci` script to set up a development virtual environment and verify your local setup: + +```bash +hatch run ci +``` + +Running the `ci` script will: +- Cause Hatch to set up a development virtual environment +- Install pre-commit hooks +- Run the pre-commit hooks, including type checks +- Run the unit tests + +Now you are ready to contribute to Pook! If there is a specific issue you'd like to work on, leave a comment expressing your interest and any questions you have for maintainers regarding implementation details. + +When contributing code, please add unit tests for all changes and documentation for any non-internal changes. + +## Testing + +Pook supports all actively supported CPython versions, as well as the latest Pypy version. To run Pook's test suite for each supported interpreter, run the following: + +```bash +hatch run test:test +``` + +Note that each interpreter requires a new virtual environment, and hatch will automatically handle creating these. + +To run tests only for a specific version, affix the version designation to the environment name (the left side of the `:`): + +```bash +hatch run test.pypy3.10:test +``` + +## Documentation + +Generate the documentation site by running: + +```bash +hatch run docs:build +``` + +## Building for distribution + +Use Hatch's build tools to create the Pook distribution: + +```bash +hatch build -c +``` diff --git a/README.rst b/README.rst index 26f7fae..31c8541 100644 --- a/README.rst +++ b/README.rst @@ -240,57 +240,10 @@ Example using Hy language (Lisp dialect for Python): (defmain [&args] (run)) -Development ------------ - -Clone the repository: - -.. code:: bash - - git clone git@github.com:h2non/pook.git - - -Use [`hatch`](https://hatch.pypa.io/) to configure the environment by running the test suite: - -.. code:: bash - - hatch run test - - -Install the pre-commit hook: - -.. code:: bash - - hatch run lint-install - - -Lint the code: - -.. code:: bash - - hatch run lint - - -Run tests on all supported Python versions and implementations (this requires your host operating system to have each implementation available): - -.. code:: bash - - hatch run test:test - - -To run tests only for a specific version, affix the version designation to the environment name (the left side of the `:`): - -.. code:: bash - - hatch run test.pypy3.10:test - - -Generate documentation: - -.. code:: bash - - hatch run docs:build +Contributing +------------ +See `contributing <./CONTRIBUTING.md>`_ for how to contribute to Pook. License ------- diff --git a/pyproject.toml b/pyproject.toml index bfea186..404f43e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,11 +72,16 @@ extra-dependencies = [ ] [tool.hatch.envs.default.scripts] +ci = [ + "lint-install", + "lint", + "test", +] test = "pytest {args}" -types = "mypy --install-types --non-interactive src/pook/interceptors {args}" lint-install = "pre-commit install" lint = "pre-commit run --all-files" +types = "mypy --install-types --non-interactive src/pook/interceptors {args}" [tool.hatch.envs.docs] extra-dependencies = [