Skip to content

Commit

Permalink
tweaking the poetry install setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeftor committed Jan 3, 2024
1 parent ab7f099 commit d69c320
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 12 deletions.
43 changes: 33 additions & 10 deletions .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,40 @@ on:
- pull_request

jobs:
tests:
name: Poetry Testing
ci:
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
poetry-version: ["1.7.1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: Gr1N/setup-poetry@v8
- uses: actions/cache@v2
python-version: ${{ matrix.python-version }}

- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install --all-extras
- name: Ensure xdist
run: poetry add pytest-xdist
- name: Run the automated tests (for example)
run: poetry run pytest
- name: Upload coverage report
uses: codecov/[email protected]
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- run: pytest
files: ./cov.xml
36 changes: 35 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ classifiers = ["Development Status :: 5 - Production/Stable",

]

[virtualenvs]
create = true
in-project = true

[tool.poetry.urls]
"Bug Tracker" = "https://github.com/jeeftor/intellifire4py/issues"
Changelog = "https://github.com/jeeftor/intellifire4py/releases"
Expand Down Expand Up @@ -57,6 +61,7 @@ xdoctest = "^1.1.1"
pytest-cov = "^4.1.0"
ruff = "0.1.4"
aioresponses = "^0.7.6"
pytest-xdist = "^3.5.0"


[tool.pytest.ini_options]
Expand Down Expand Up @@ -178,4 +183,4 @@ disable= [
"duplicate-code",
"format",
"unsubscriptable-object",
]
]

0 comments on commit d69c320

Please sign in to comment.