Skip to content

Commit

Permalink
Add poetry to manage dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
monim67 committed Jan 16, 2023
1 parent 4a1f15d commit 7ed1b1d
Show file tree
Hide file tree
Showing 29 changed files with 2,668 additions and 475 deletions.
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

17 changes: 0 additions & 17 deletions .editorconfig

This file was deleted.

90 changes: 69 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,89 @@ name: build

on:
push:
branches: ['*']
branches: ["*"]
pull_request:

jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip-ci')"
pre-build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.6
uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: '3.6'
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Check poetry.lock
run: |
poetry env use ${{ matrix.python-version }}
poetry lock --check
- name: Install
run: python3 -m pip install -r requirements/build.txt
- name: Install dependencies
run: |
poetry env use ${{ matrix.python-version }}
poetry install --no-root --only build --no-ansi --no-interaction
poetry run pip install -c tests/pip-constraints.txt .
- name: Lint
run: make lint
run: poetry run poe lint

- name: Test & Coverage
run: make coverage
- name: Test Coverage
run: poetry run poe test-cov

- name: Coveralls.io notification
uses: AndreMiras/coveralls-python-action@develop
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.python-version }}
parallel: true
flag-name: Unit Test

coveralls_finish:
needs: build
build:
runs-on: ubuntu-latest
needs: pre-build
strategy:
matrix:
python-version: ["3.10", "3.9", "3.8", "3.7"]
steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Install dependencies
run: |
poetry env use ${{ matrix.python-version }}
poetry install --no-root --only build --no-ansi --no-interaction
poetry run pip install -c tests/pip-constraints.txt .
- name: Test Coverage
run: poetry run poe test-cov

- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.python-version }}
parallel: true

coveralls:
runs-on: ubuntu-latest
needs: build
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
31 changes: 16 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy
name: Deploy to PyPI

on:
release:
Expand All @@ -7,21 +7,22 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: "false"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install poetry
run: |
pipx install poetry
poetry self add poetry-bumpversion
- name: Install dependencies
run: 'python -m pip install build wheel --user'
- name: Build
run: |
poetry version ${{ github.ref_name }}
poetry build
- name: Build
run: make build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish
13 changes: 9 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
.vscode
node_modules
*.sqlite3
/venv*
/media

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Byte-compiled / optimized / DLL files
__pycache__/
Expand All @@ -15,6 +20,7 @@ htmlcov/
.tox/
.coverage
.coverage.*
coverage/
.cache
nosetests.xml
coverage.xml
Expand All @@ -40,4 +46,3 @@ wheels/
*.egg-info/
.installed.cfg
*.egg

11 changes: 0 additions & 11 deletions .pylintrc

This file was deleted.

14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"python.formatting.provider": "black",
"python.linting.mypyEnabled": true,
"python.linting.pydocstyleEnabled": true,
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
}
},
"esbonio.sphinx.confDir": ""
}
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

33 changes: 0 additions & 33 deletions Makefile

This file was deleted.

Empty file removed dev/myapp/__init__.py
Empty file.
15 changes: 0 additions & 15 deletions dev/myapp/urls.py

This file was deleted.

46 changes: 0 additions & 46 deletions dev/myapp/views.py

This file was deleted.

Loading

0 comments on commit 7ed1b1d

Please sign in to comment.