Skip to content

Commit

Permalink
Feature/T9-update-project-dependencies (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmayd authored Oct 23, 2023
2 parents de02d11 + 060f687 commit 63ba77b
Show file tree
Hide file tree
Showing 5 changed files with 2,200 additions and 1,513 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
os: [ubuntu-18.04, macOS-latest, windows-latest]
os: [ubuntu-22.04, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v3
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Run poetry image
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.1.13
poetry-version: 1.6.1
- name: Install dependencies
run: |
poetry install
Expand All @@ -44,8 +44,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.10.2]
poetry-version: [1.1.13]
python-version: [3.10.13]
poetry-version: [1.6.1]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: "(doc|dist)"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0 # Use the ref you want to point at
rev: v4.5.0 # Use the ref you want to point at
hooks:
- id: check-yaml
- id: check-toml
Expand All @@ -12,17 +12,17 @@ repos:
- id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args: ["--profile", "black", "--filter-files", "--line-length", "80"]
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.10.0
hooks:
- id: black
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.14.2
rev: 0.27.0
hooks:
- id: check-jsonschema
name: "Check GitHub Workflows"
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,18 @@ Contributions to this project are highly appreciated! You can either contact the

To contribute to this project, please follow these steps:

1. Install [poetry](https://python-poetry.org/docs/). We recommend installing `poetry` via [pipx](https://pypa.github.io/pipx/) which gives you a global `poetry` command in an isolated virtual environment.
2. Clone the repository via git.
3. Change into the project root directory.
4. Run `poetry install` to create the virtual environment within `poetry`'s cache folder (run `poetry env info` to see the details of this new virtual environment). `poetry` has installed all dependencies for you, as well as the package itself.
5. Install pre-commit: `poetry run pre-commit install`. This will activate the pre-commit hooks that will run prior every commit to ensure code quality.
6. Do your changes.
7. Run `poetry run pytest` to see if all existing tests still run through. It is important to use `poetry run` to call `pytest` so that `poetry` uses the created virtual environment and not the system's default Python interpreter. Alternatively, you can run `poetry shell` to let `poetry` activate the virtual environment for the current session. Afterwards, you can run `pytest` as usual without any prefix. You can leave the poetry shell with the `exit` command.
8. Add new tests depending on your changes.
9. Run `poetry run pytest` again to make sure your tests are also passed.
10. Commit and push your changes.
11. Create a PR.
1. Create a new virtual environment, for example with [conda](https://docs.conda.io/en/latest/) or the standard [venv](https://docs.python.org/3/library/venv.html) and make sure your Python version matches the minimum version for this project.
2. Install [poetry](https://python-poetry.org/docs/) inside your venv. You can do so either with `conda install poetry` or `pip install poetry`, depending on your package manager.
3. Clone the repository via git.
4. Change into the project root directory.
5. Run `poetry install` to create the virtual environment within `poetry`'s cache folder (run `poetry env info` to see the details of this new virtual environment). `poetry` has installed all dependencies for you, as well as the package `pystatis` itself.
6. Install pre-commit: `poetry run pre-commit install`. This will activate the pre-commit hooks that will run prior every commit to ensure code quality.
7. Do your changes.
8. Run `poetry run pytest` to see if all existing tests still run through. It is important to use `poetry run` to call `pytest` so that `poetry` uses the created virtual environment and not the system's default Python interpreter. Alternatively, you can run `poetry shell` to let `poetry` activate the virtual environment for the current session. Afterwards, you can run `pytest` as usual without any prefix. You can leave the poetry shell with the `exit` command.
9. Add new tests depending on your changes.
10. Run `poetry run pytest` again to make sure your tests are also passed.
11. Commit your changes. This will trigger all pre-commit hooks as defined in `.pre-commit-config.yaml`. If any of these pre-hooks fails, your commit is declined and you have to fix the issues first.
12. Push your changes.
13. Create a PR.

To learn more about `poetry`, see [Dependency Management With Python Poetry](https://realpython.com/dependency-management-python-poetry/#command-reference) by realpython.com.
Loading

0 comments on commit 63ba77b

Please sign in to comment.