Skip to content

Commit

Permalink
Update tooling (#96)
Browse files Browse the repository at this point in the history
Drop Python 2
Drop Python <3.6
Clean code with pre-commit
  • Loading branch information
yakky committed Nov 27, 2020
1 parent 22f431a commit 087e10b
Show file tree
Hide file tree
Showing 81 changed files with 2,434 additions and 2,159 deletions.
1 change: 1 addition & 0 deletions .checkignore
@@ -0,0 +1 @@
tests/*
7 changes: 7 additions & 0 deletions .codeclimate.yaml
@@ -0,0 +1,7 @@
languages:
Ruby: false
JavaScript: false
PHP: false
Python: true
exclude_paths:
- 'taiga/tests/*'
2 changes: 1 addition & 1 deletion .coveragerc
Expand Up @@ -3,7 +3,7 @@ branch = True
source = taiga

[report]
omit = *test_utils*
omit =
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
Expand Down
12 changes: 6 additions & 6 deletions .editorconfig
Expand Up @@ -8,27 +8,27 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80
max_line_length = 120

[*.md]
trim_trailing_whitespace = false

[*.rst]
max_line_length = 80
max_line_length = 120

[*.py]
max_line_length = 100
max_line_length = 120

[*.{scss,html}]
indent_size = 4
indent_size = 2
indent_style = space
max_line_length = 120

[*.js]
[*.{js,vue,json}]
indent_size = 2
max_line_length = 120

[*.yml]
[*.{yml,yaml}]
indent_size = 2

[Makefile]
Expand Down
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/---bug-report.md
@@ -0,0 +1,48 @@
---
name: "\U0001F41B Bug report"
about: Create a report to help us improve
title: ''
labels: 'type: bug'
assignees: ''

---

<!--
Please fill in each section to help maintainers to be helpful and quick to respond.
-->

## Description

<!--
Describe issue in general terms.
-->

## Steps to reproduce

<!--
Provide clear steps to reproduce the issue.
-->

## Versions

<!--
Provide at least Python, Django and application version.
-->

## Expected behaviour

<!--
Provide what you would have expected to happen.
-->

## Actual behaviour

<!--
Provide what happened.
-->

## Additional information

<!--
Add any other information.
-->
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/---feature-request.md
@@ -0,0 +1,42 @@
---
name: "\U0001F389 Feature request"
about: Share your idea, let's discuss it!
title: ''
labels: 'type: feature'
assignees: ''

---

<!--
Please fill in each section to help maintainers to be helpful and quick to respond.
-->

## Description

<!--
Describe the feature in general terms.
-->

## Use cases

<!--
What use cases these feature will address?
-->

## Proposed solution

<!--
A clear and concise description of what you want to happen.
-->

## Alternatives

<!--
A clear and concise description of any alternative solutions or features you've considered.
-->

## Additional information

<!--
Add any other information.
-->
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
@@ -0,0 +1,18 @@
# Description

Describe:

* Content of the pull request
* Feature added / Problem fixed

## References

Provide any github issue fixed (as in ``Fix #XYZ``)

# Checklist

* [ ] I have read the [contribution guide](https://python-taiga.readthedocs.io/en/latest/contributing.html)
* [ ] Code lint checked via `inv lint`
* [ ] ``changes`` file included (see [docs](https://python-taiga.readthedocs.io/en/latest/contributing.html#pull-request-guidelines))
* [ ] Usage documentation added in case of new features
* [ ] Tests added
18 changes: 18 additions & 0 deletions .github/workflows/debian_package.yml
@@ -0,0 +1,18 @@
name: Build debian package

on: [push, pull_request]

jobs:
test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get install -yq --no-install-suggests --no-install-recommends devscripts fakeroot equivs dh-python python3-all python3-dateutil python3-requests python3-six
sudo pip install "invoke>1.4"
- name: Test building debian package
run: |
mk-build-deps -i -s sudo -t 'apt-get -yq' debian/control
inv deb
41 changes: 41 additions & 0 deletions .github/workflows/lint.yml
@@ -0,0 +1,41 @@
name: Code quality

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
python-version: [3.8]
toxenv: [pep8, isort, black, pypi-description, docs, towncrier]
steps:
- uses: actions/checkout@v2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.toxenv }}
- name: Cache tox
uses: actions/cache@v1
with:
path: .tox
key: ${{ runner.os }}-lint-${{ matrix.toxenv }}-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-lint-${{ matrix.toxenv }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox>=1.8
- name: Test with tox
run: |
tox -e${{ matrix.toxenv }}
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,38 @@
name: Upload Python Package

on:
release:
types: [published,prereleased]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.toxenv }}
- name: Cache tox
uses: actions/cache@v1
with:
path: .tox
key: ${{ runner.os }}-tox-release-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-tox-release-
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox>=1.8
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
tox -erelease
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,51 @@
name: Tox tests

on: [push, pull_request]

jobs:
test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, 3.8, 3.7, 3.6]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.toxenv }}
- name: Cache tox
uses: actions/cache@v1
with:
path: .tox
key: ${{ runner.os }}-tox-${{ format('{{py{0}}}', matrix.python-version) }}-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-tox-${{ format('{{py{0}}}', matrix.python-version) }}-
- name: Install dependencies
run: |
sudo apt-get install gettext
python -m pip install --upgrade pip tox>=3.5
- name: Test with tox
env:
TOX_ENV: ${{ format('py', matrix.python-version) }}
COMMAND: coverage run
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
tox -e$TOX_ENV
.tox/$TOX_ENV/bin/coverage xml
.tox/$TOX_ENV/bin/coveralls
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
file: ./coverage.xml
fail_ci_if_error: false
44 changes: 22 additions & 22 deletions .gitignore
@@ -1,4 +1,7 @@
*.py[co]
*.py[cod]

# C extensions
*.so

# Packages
*.egg
Expand All @@ -8,38 +11,35 @@ build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
scratch
env
venv*
lib
lib64

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml

.DS_Store

# Sphinx
docs/tmp
docs/_build
cover
# Translations
*.mo

# PyCharm/IntelliJ
.idea
# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Visual Studio Code
.vscode

#htmlcov
*htmlcov*
/.pybuild/
/debian/python-taiga*
/debian/python3-taiga*
/debian/.debhelper/
/debian/files
/debian/*build*
demo.py
docs/_build/
.pybuild
debian/.debhelper
debian/debhelper*
debian/files
debian/python-taiga*
debian/python3-taiga*

0 comments on commit 087e10b

Please sign in to comment.