Using poetry and ruff on gitlab-ci

This commit is contained in:
Roger Gonzalez 2024-03-02 10:13:58 -03:00
parent f3245a6826
commit f76daf6ddf
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6

View File

@ -3,18 +3,18 @@ image: python:latest
lint:
stage: test
before_script:
- pip install black flake8 isort flake8-bugbear flake8-builtins flake8-comprehensions flake8-tidy-imports flake8-eradicate flake8-print flake8-return flake8-use-fstring git+https://github.com/derrix060/flake8-expression-complexity.git
- pip install poetry
- poetry install --no-root
script:
- black --check src/
- flake8 src/
- isort -c src/
- poetry run ruff check ./src
- poetry run ruff format --check ./src
deploy_to_pypi:
stage: deploy
only:
- master
before_script:
- pip install build twine
- pip install poetry
- poetry install --no-root
script:
- python -m build
- TWINE_PASSWORD=$PYPI_PASSWORD TWINE_USERNAME=$PYPI_USERNAME python3 -m twine upload dist/*
- POETRY_PYPI_TOKEN_PYPI=$PYPI_PASSWORD poetry publish --build