Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
chore: Updates poetry dependency sync w/ CI (#39)
Browse files Browse the repository at this point in the history
* chore: Updates poetry lock

* docs: Updates makefile

* ci: Updates style job

* ci: Fixes poetry resolution in CI
  • Loading branch information
frgfm authored Dec 7, 2023
1 parent 440764f commit fb35651
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 35 deletions.
39 changes: 32 additions & 7 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,26 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: x64
- uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.6.1"
- name: Resolve dependencies
run: poetry export -f requirements.txt --without-hashes --only quality --output requirements.txt
- name: Cache python modules
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run ruff
run: |
pip install "ruff==0.1.7"
ruff --version
ruff check --diff .
Expand All @@ -42,7 +55,7 @@ jobs:
with:
poetry-version: "1.6.1"
- name: Resolve dependencies
run: poetry export -f requirements.txt --without-hashes --output requirements.txt
run: poetry export -f requirements.txt --without-hashes --with quality --output requirements.txt
- name: Cache python modules
uses: actions/cache@v2
with:
Expand All @@ -51,8 +64,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt --upgrade
pip install "mypy==1.4.1" types-requests types-python-jose types-passlib
pip install -r requirements.txt
- name: Run mypy
run: |
mypy --version
Expand All @@ -67,12 +79,25 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: x64
- uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.6.1"
- name: Resolve dependencies
run: poetry export -f requirements.txt --without-hashes --only quality --output requirements.txt
- name: Cache python modules
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run ruff
run: |
pip install "ruff==0.1.3"
ruff --version
ruff format --check --diff .
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
poetry-version: "1.6.1"
- name: Resolve dependencies
run: poetry export -f requirements.txt --without-hashes --with dev --output requirements.txt
run: poetry export -f requirements.txt --without-hashes --with test --output requirements.txt
- name: Build & run docker
env:
SUPERADMIN_GH_PAT: ${{ secrets.SUPERADMIN_GH_PAT }}
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ stop:
docker compose down

run-dev:
poetry export -f requirements.txt --without-hashes --with dev --output requirements.txt
poetry export -f requirements.txt --without-hashes --with test --output requirements.txt
docker compose -f docker-compose.test.yml up -d --build

stop-dev:
docker compose -f docker-compose.test.yml down

# Run tests for the library
test:
poetry export -f requirements.txt --without-hashes --with dev --output requirements.txt
poetry export -f requirements.txt --without-hashes --with test --output requirements.txt
docker compose -f docker-compose.test.yml up -d --build
docker compose exec -T backend pytest --cov=app
docker compose -f docker-compose.test.yml down
Expand Down
36 changes: 18 additions & 18 deletions poetry.lock

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

20 changes: 13 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,21 @@ sentry-sdk = { version = "^1.14.0", extras = ["fastapi"] }
alembic = "^1.8.1"
posthog = "^3.0.0"

[tool.poetry.group.quality]
optional = true

[tool.poetry.group.quality.dependencies]
ruff = { version = "==0.1.7", optional = true }
mypy = { version = "==1.6.1", optional = true }
types-requests = { version = ">=2.0.0", optional = true }
types-python-jose = { version = ">=3.3.0", optional = true }
types-passlib = { version = ">=1.7.0", optional = true }
pre-commit = { version = "^2.17.0", optional = true }
ruff = "==0.1.7"
mypy = "==1.6.1"
types-requests = ">=2.0.0"
types-python-jose = ">=3.3.0"
types-passlib = ">=1.7.0"
pre-commit = "^2.17.0"

[tool.poetry.group.test]
optional = true

[tool.poetry.group.dev.dependencies]
[tool.poetry.group.test.dependencies]
pytest = ">=5.3.2,<8.0.0"
pytest-asyncio = ">=0.17.0,<1.0.0"
httpx = ">=0.23.0"
Expand Down

0 comments on commit fb35651

Please sign in to comment.