Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Poetry #20

Merged
merged 25 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
13c1502
Initiate pyproject.toml file with poetry
oncleben31 Jul 24, 2020
811076c
Initiate poetry.lock file
oncleben31 Jul 24, 2020
478f04c
Add requests in the dependencies
oncleben31 Jul 24, 2020
b393d28
Add pytz in the dependencies
oncleben31 Jul 24, 2020
a29db7d
Add pydev in dev dependencies
oncleben31 Jul 24, 2020
ac76885
Archive previous configuration files
oncleben31 Jul 24, 2020
281e777
Add meteofrance Python module location in project file
oncleben31 Jul 26, 2020
9347222
Add Python module version in __init__ file
oncleben31 Jul 26, 2020
d30ae13
Add requests-mock in dev dependencies
oncleben31 Jul 26, 2020
8004629
Add pytest-cov in dev dependencies
oncleben31 Jul 26, 2020
d834aab
Add toml extras in coverage dependency
oncleben31 Jul 26, 2020
3bd0199
Transfer coverage settings in pyproject.toml file
oncleben31 Jul 26, 2020
f312e65
Add Pypi classifiers in pyproject.toml
oncleben31 Jul 26, 2020
14acdb6
Remove .coveragerc file as no more used
oncleben31 Jul 26, 2020
6454b2e
Fix typo in pyproject file
oncleben31 Jul 26, 2020
0d2872e
flake8 settings migrated to .flake8 file
oncleben31 Jul 26, 2020
5cc3f2e
Update flake8 settings adding more checks
oncleben31 Jul 26, 2020
f13ac45
Add flake8-docstrings in dev dependencies
oncleben31 Jul 26, 2020
de20b41
Remove setup.cfg because no more used
oncleben31 Jul 26, 2020
fc61247
Remove setup.py because no more used
oncleben31 Jul 26, 2020
1b0da99
Update GitHub workflow for lint and tests checks
oncleben31 Jul 26, 2020
2016caf
Update GitHub workflow for PyPi publication
oncleben31 Jul 26, 2020
66a0fd5
Add ignored rules to align flake8 and black
oncleben31 Jul 27, 2020
8ab92c1
Fix flake8 linting errors
oncleben31 Jul 27, 2020
c309870
Bump package version
oncleben31 Jul 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .coveragerc

This file was deleted.

24 changes: 6 additions & 18 deletions setup.cfg → .flake8
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@


[metadata]
description-file = README.md

[tool:pytest]
addopts = --verbose
python_files = tests/*.py

[tool:isort]
line_length = 88
multi_line_output = 3
include_trailing_comma = true

[flake8]
select = C,D,E,F,W
max-complexity = 10
docstring-convention = google
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build,.eggs
doctests = True

# To work with Black
max-line-length = 88
# E501: line too long
# W503: Line break occurred before a binary operator
# E203: Whitespace before ':'
# D202 No blank lines allowed after function docstring
# W504 line break after binary operator
# ignore =
ignore = W503
# E501,
# W503,
# E203,
# D202,
# W504
# W504
37 changes: 12 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,25 @@
name: "Release actions"

name: Release
on:
push:
tags:
- "*"
release:
types: [published]

jobs:
deploy:
release:
runs-on: ubuntu-latest
name: Deploy to PyPi
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.x"
python-version: "3.8"
architecture: x64

- name: Install dependencies
run: python -m pip install setuptools wheel twine black pytest .[testing]

- run: python3 -m black .

- run: python3 -m pytest

- uses: olegtarasov/get-tag@v2
name: Set tag envronment variable
run: pip install poetry==1.0.9

- name: Set version number
run: |
sed -i "s/version=\"0.0.0\"/version=\"$GIT_TAG_NAME\"/" ${{github.workspace}}/setup.py
- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
# - run: python3 -m black .
- run: poetry install
- run: poetry run pytest
- run: poetry build
- run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
15 changes: 5 additions & 10 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,18 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Requirements for package tests
pip install .[testing]

# Requirement for CI tests
pip install flake8
pip install poetry==1.0.9
poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
poetry run flake8
- name: Test with pytest
run: |
pytest --cov --cov-report=xml
poetry run pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
Loading