Skip to content

Commit

Permalink
Merge branch 'h2non:master' into add_off
Browse files Browse the repository at this point in the history
  • Loading branch information
shift0965 authored Oct 15, 2024
2 parents 014913c + e2fa075 commit de02e88
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 51 deletions.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Description
<!--- Describe your changes in detail -->
<!--- What problem does this change solve? -->
<!--- If this PR relates to an issue, include Refs #XXX or Fixes #XXX -->

## PR Checklist

- [ ] I've added tests any code changes
- [ ] I've documented any new features
48 changes: 48 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -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
59 changes: 59 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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
```
53 changes: 3 additions & 50 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit de02e88

Please sign in to comment.