Skip to content

Commit

Permalink
Switch to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed Feb 23, 2023
1 parent c00e73c commit bd56f4a
Show file tree
Hide file tree
Showing 7 changed files with 3,234 additions and 148 deletions.
60 changes: 22 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,33 +102,29 @@ commands:
name: Installing psql client, enchant, netcat, rust
command: $SUDO apt -y install postgresql-client netcat python3-enchant rustc

- run:
name: Installing poetry if needed
command: which poetry || $SUDO apt -y install python-poetry

- restore_cache:
keys:
- v21-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum
"requirements.txt" }}
- v1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum
"poetry.lock" }}
# fallback to using the latest cache if no exact match is found
- v21-dependencies-{{ .Environment.CIRCLE_JOB }}

- run:
name: install latest pip
command: |
$PYTHON_INTERPRETER -m venv venv
. venv/bin/activate
pip install -U pip
- v1-dependencies-{{ .Environment.CIRCLE_JOB }}

- run:
name: install dependencies
command: |
PATH=$PATH:/root/.cargo/bin/
$PYTHON_INTERPRETER -m venv venv
. venv/bin/activate
pip install -vUr requirements.txt
name: install python dependencies
working_directory: irrd
environment:
POETRY_VIRTUALENVS_IN_PROJECT: true
command: poetry -n --no-ansi --no-root --with=dev,docs install

- save_cache:
paths:
- ./venv
key: v21-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum
"requirements.txt" }}
- /mnt/ramdisk/.venv
key: v1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum
"poetry.lock" }}

wait_for_postgres:
steps:
Expand All @@ -147,9 +143,7 @@ commands:
steps:
- run:
name: run regular tests
command: |
. venv/bin/activate
py.test -s -vvvv --cov=irrd irrd --junitxml=test-reports/junit.xml --cov-fail-under=100 --cov-report term-missing:skip-covered
command: poetry -n --no-ansi py.test -s -vvvv --cov=irrd irrd --junitxml=test-reports/junit.xml --cov-fail-under=100 --cov-report term-missing:skip-covered

create_integration_test_db:
steps:
Expand All @@ -167,9 +161,7 @@ commands:
steps:
- run:
name: run integration tests
command: |
. venv/bin/activate
py.test irrd/integration_tests/run.py -s
command: poetry -n --no-ansi py.test irrd/integration_tests/run.py -s

store_results:
steps:
Expand Down Expand Up @@ -352,21 +344,15 @@ jobs:

- run:
name: run ruff
command: |
. venv/bin/activate
ruff irrd
command: poetry -n --no-ansi ruff irrd

- run:
name: run isort
command: |
. venv/bin/activate
isort --check --diff irrd
command: poetry -n --no-ansi isort --check --diff irrd

- run:
name: run mypy
command: |
. venv/bin/activate
mypy irrd
command: poetry -n --no-ansi mypy irrd


build_docs:
Expand Down Expand Up @@ -398,13 +384,11 @@ jobs:
- run:
name: hack sphinx_immaterial
command: |
sed -i 's/max_workers=32/max_workers=1/' /mnt/ramdisk/venv/lib/py*/site-packages/sphinx_immaterial/google_fonts.py
sed -i 's/max_workers=32/max_workers=1/' /mnt/ramdisk/.venv/lib/py*/site-packages/sphinx_immaterial/google_fonts.py
- run:
name: build docs
command: |
. venv/bin/activate
sphinx-build -nW -b spelling docs/ docs/build
command: poetry -n --no-ansi sphinx-build -nW -b spelling docs/ docs/build

- save_cache:
paths:
Expand Down
3 changes: 0 additions & 3 deletions .isort.cfg

This file was deleted.

Loading

0 comments on commit bd56f4a

Please sign in to comment.