Skip to content

Commit a519f26

Browse files
authored
bump version, merge pull request #31 from iterative/devel
2 parents 2cd1933 + c057a5d commit a519f26

File tree

8 files changed

+48
-50
lines changed

8 files changed

+48
-50
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ jobs:
1818
with:
1919
path: ~/.cache/pre-commit
2020
key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
21-
- run: pip install -U -r requirements-dev.txt
22-
- run: python setup.py sdist bdist_wheel
23-
- run: twine check dist/*
21+
- run: pip install -U pre-commit
2422
- uses: reviewdog/action-setup@v1
2523
- run: |
2624
pre-commit run -a flake8 | reviewdog -f=pep8 -name=flake8 -tee -reporter=github-check -filter-mode nofilter
@@ -42,28 +40,27 @@ jobs:
4240
with:
4341
python-version: ${{ matrix.python }}
4442
- run: pip install -U -r requirements-dev.txt
45-
- run: python -m tests --cov-report=term-missing
43+
- run: pytest
4644
- uses: codecov/codecov-action@v1
4745
deploy:
48-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
4946
name: PyPI Deploy
5047
needs: [check, test]
5148
runs-on: ubuntu-latest
5249
steps:
5350
- uses: actions/checkout@v2
5451
with:
5552
fetch-depth: 0
56-
- uses: casperdcl/deploy-pypi@v1
53+
- uses: actions/setup-python@v2
54+
- id: dist
55+
uses: casperdcl/deploy-pypi@v2
5756
with:
58-
password: ${{ secrets.PYPI_TOKEN }}
5957
build: true
60-
- id: collect_assets
61-
name: Collect assets
62-
run: |
63-
echo "::set-output name=asset_path::$(ls dist/*.whl)"
64-
echo "::set-output name=asset_name::$(basename dist/*.whl)"
65-
git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
66-
- id: create_release
58+
password: ${{ secrets.PYPI_TOKEN }}
59+
upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
60+
- name: Changelog
61+
run: git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
62+
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
63+
id: create_release
6764
uses: actions/create-release@v1
6865
env:
6966
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -72,11 +69,12 @@ jobs:
7269
release_name: shtab ${{ github.ref }} beta
7370
body_path: _CHANGES.md
7471
draft: true
75-
- uses: actions/upload-release-asset@v1
72+
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
73+
uses: actions/upload-release-asset@v1
7674
env:
7775
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7876
with:
7977
upload_url: ${{ steps.create_release.outputs.upload_url }}
80-
asset_path: ${{ steps.collect_assets.outputs.asset_path }}
81-
asset_name: ${{ steps.collect_assets.outputs.asset_name }}
78+
asset_path: dist/${{ steps.dist.outputs.whl }}
79+
asset_name: ${{ steps.dist.outputs.whl }}
8280
asset_content_type: application/zip

.pre-commit-config.yaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,43 @@ default_language_version:
22
python: python3
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v2.4.0
5+
rev: v3.4.0
66
hooks:
77
- id: check-added-large-files
88
- id: check-case-conflict
99
- id: check-docstring-first
1010
- id: check-executables-have-shebangs
1111
- id: check-toml
12+
- id: check-merge-conflict
1213
- id: check-yaml
14+
- id: debug-statements
1315
- id: end-of-file-fixer
1416
- id: mixed-line-ending
17+
- id: sort-simple-yaml
1518
- id: trailing-whitespace
16-
- hooks:
19+
- repo: local
20+
hooks:
21+
- id: todo
22+
name: Check TODO
23+
language: pygrep
24+
entry: TODO
25+
types: [text]
26+
exclude: ^(.pre-commit-config.yaml|.github/workflows/test.yml)$
27+
args: [-i]
28+
- repo: https://gitlab.com/pycqa/flake8
29+
rev: 3.8.4
30+
hooks:
1731
- id: flake8
1832
additional_dependencies:
1933
- flake8-bugbear
2034
- flake8-comprehensions
2135
- flake8-debugger
2236
- flake8-string-format
23-
repo: https://gitlab.com/pycqa/flake8
24-
rev: 3.8.4
25-
- hooks:
26-
- id: black
27-
repo: https://github.com/psf/black
37+
- repo: https://github.com/psf/black
2838
rev: 19.10b0
29-
- hooks:
39+
hooks:
40+
- id: black
41+
- repo: https://github.com/PyCQA/isort
42+
rev: 5.7.0
43+
hooks:
3044
- id: isort
31-
repo: https://github.com/timothycrosley/isort
32-
rev: 5.6.4

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
When contributing pull requests, it's a good idea to run basic checks locally:
66

77
```bash
8-
shtab (master)$ pip install .[dev] # install development dependencies
8+
# install development dependencies
9+
shtab (master)$ pip install pre-commit -r requirements-dev.txt
910
shtab (master)$ pre-commit install # install pre-commit checks
10-
shtab (master)$ python -m tests # run all tests
11+
shtab (master)$ pytest # run all tests
1112
```
1213

1314
## Layout

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ write_to = "shtab/_dist_ver.py"
77
write_to_template = "__version__ = '{version}'\n"
88

99
[tool.black]
10-
target-version = ['py27', 'py36']
10+
target_version = ["py27", "py36", "py38"]

requirements-dev.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
pre-commit
2-
twine
3-
wheel
41
pytest
52
pytest-cov
3+
pytest-timeout

setup.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ packages=find:
7070
[options.entry_points]
7171
console_scripts=
7272
shtab=shtab.main:main
73+
[options.packages.find]
74+
exclude=tests
7375
[bdist_wheel]
7476
universal=1
7577

@@ -81,3 +83,7 @@ exclude=build,dist,.eggs,.git,__pycache__
8183
[isort]
8284
profile=black
8385
known_first_party=shtab
86+
87+
[tool:pytest]
88+
timeout=5
89+
addopts=-v --tb=short -rxs -W=error --log-level=debug --durations=0 --cov=shtab --cov-report=term-missing --cov-report=xml

tests/__main__.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/test_shtab.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"""
22
Tests for `shtab`.
3-
4-
Currently runnable via nosetests, e.g.:
5-
shtab$ nose tests -d -v
63
"""
74
import logging
85
import subprocess

0 commit comments

Comments
 (0)