fix: replace requirements.txt files with poetry

This commit is contained in:
Brian May 2025-02-06 15:51:02 +11:00 committed by Brian May
parent 6f12698209
commit 85dc3199a3
6 changed files with 836 additions and 353 deletions

View File

@ -17,20 +17,30 @@ jobs:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
poetry-version: ["main"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Run image
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
python -m pip install --upgrade pip
pip install -r requirements-tests.txt
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
- name: Lint with flake8
run: |
flake8 sshuttle tests --count --show-source --statistics
- name: Test with pytest
run: |
PYTHONPATH=$PWD pytest
poetry run flake8 sshuttle tests --count --show-source --statistics
- name: Run the automated tests
run: poetry run pytest -v

View File

@ -4,6 +4,12 @@ build:
os: ubuntu-20.04
tools:
python: "3.9"
jobs:
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
- poetry install --with docs
sphinx:
configuration: docs/conf.py

1143
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -23,3 +23,10 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
sshuttle = "sshuttle.cmdline:main"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
sphinx = "7.1.2"
furo = "2024.8.6"

View File

@ -1,5 +0,0 @@
-r requirements.txt
pytest==8.3.4
pytest-cov==6.0.0
flake8==7.1.1
bump2version==1.0.1

View File

@ -1,2 +0,0 @@
Sphinx==7.1.2
furo==2024.8.6