Skip to content

Commit 272b853

Browse files
authored
Merge pull request #15 from cdce8p/dev
Release v0.3.1
2 parents 0c8779f + da3126f commit 272b853

File tree

10 files changed

+82
-16
lines changed

10 files changed

+82
-16
lines changed

.github/workflows/release.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
env:
9+
DEFAULT_PYTHON: 3.9
10+
11+
jobs:
12+
release-pypi:
13+
name: Upload release to PyPI
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out code from Github
17+
uses: actions/[email protected]
18+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
19+
id: python
20+
uses: actions/[email protected]
21+
with:
22+
python-version: ${{ env.DEFAULT_PYTHON }}
23+
- name: Install requirements
24+
run: |
25+
python -m pip install -U pip setuptools twine wheel
26+
- name: Build distributions
27+
run: |
28+
python setup.py sdist bdist_wheel
29+
- name: Upload to PyPI
30+
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
31+
env:
32+
TWINE_REPOSITORY: pypi
33+
TWINE_USERNAME: __token__
34+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
35+
run: |
36+
twine upload --verbose dist/*

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.10.1
3+
rev: v2.11.0
44
hooks:
55
- id: pyupgrade
66
args: [--py38-plus]
@@ -12,7 +12,7 @@ repos:
1212
files: ^(python_typing_update|script|tests)/.+\.py$
1313
exclude: *fixtures
1414
- repo: https://github.com/PyCQA/isort
15-
rev: 5.7.0
15+
rev: 5.8.0
1616
hooks:
1717
- id: isort
1818
exclude: *fixtures

.vscode/tasks.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Build package",
8+
"type": "shell",
9+
"command": "rm -rf build dist *.egg-info; source venv/bin/activate; python setup.py sdist bdist_wheel",
10+
"group": {
11+
"kind": "build",
12+
"isDefault": true,
13+
},
14+
},
15+
]
16+
}

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ It uses token analysis and
1212
to try and update the typing syntax the best it can.
1313

1414
**Important**
15-
Since every project uses a different formatting style,
16-
always check `git diff` before committing any changes!
15+
Every project uses a different formatting style,
16+
so always check `git diff` before comitting any changes!
1717
Since this tool uses [pyupgrade][pyu], it's best used for
1818
projects that use it already.
1919

@@ -119,7 +119,7 @@ Set the minimum Python syntax version to **3.10**. (Default: **3.8**)
119119

120120
## License
121121
This Project is licensed under the MIT license.
122-
See [LICENSE](LICENSE) for the full license text.
122+
See [LICENSE][LICENSE_FILE] for the full license text.
123123

124124

125125
[pri]: https://github.com/asottile/reorder_python_imports
@@ -129,3 +129,5 @@ See [LICENSE](LICENSE) for the full license text.
129129
[black]: https://github.com/psf/black
130130
[PEP585]: https://www.python.org/dev/peps/pep-0585/
131131
[PEP604]: https://www.python.org/dev/peps/pep-0604/
132+
133+
[LICENSE_FILE]: https://github.com/cdce8p/python-typing-update/blob/main/LICENSE

python_typing_update/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def async_main(argv: list[str] | None = None) -> int:
6767
parser.add_argument(
6868
'--disable-committed-check',
6969
action='store_true',
70-
help="Don't abort with uncommited changes. Don't use it in production!",
70+
help="Don't abort with uncommitted changes. Don't use it in production!",
7171
)
7272

7373
group_mode = mode_options.add_mutually_exclusive_group()

python_typing_update/const.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
from enum import Flag, auto
77
from typing import NamedTuple
88

9-
version = (0, 3, 0)
10-
dev_version = None
9+
version = (0, 3, 1)
10+
dev_version = None # Set to `None` for release
1111

1212
version_str = '.'.join(map(str, version))
1313
if dev_version is not None:
14-
version_str += f'-dev{dev_version}'
14+
version_str += f'.dev{dev_version}'
1515

1616

1717
class FileAttributes(NamedTuple):

python_typing_update/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ async def async_run(args: argparse.Namespace) -> int:
148148
1: Check did not pass, files would be updated
149149
2: Couldn't update all files
150150
10: At least one file doesn't exist
151-
11: Uncommited changes in '.py' files
151+
11: Uncommitted changes in '.py' files
152152
12: Debug mode
153153
"""
154154
if file_errors := check_files_exist(args.filenames):

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
aiofiles==0.6.0
22
autoflake==1.4
3-
isort==5.7.0
4-
pyupgrade==2.10.1
3+
isort==5.8.0
4+
pyupgrade==2.11.0
55
reorder-python-imports==2.4.0

requirements_test_pre_commit.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
flake8==3.9.0
2-
isort==5.7.0
3-
pyupgrade==2.10.1
2+
isort==5.8.0
3+
pyupgrade==2.11.0

setup.cfg

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@
22
name = python-typing-update
33
author = Marc Mueller
44
description = Update Python typing syntax
5+
long_description = file:README.md
6+
long_description_content_type = text/markdown
57
keywords = typing,pep585,pep604
68
license = MIT
9+
license_files =
10+
LICENSE
11+
AUTHORS
12+
url = https://github.com/cdce8p/python-typing-update
13+
classifier =
14+
Development Status :: 4 - Beta
15+
Intended Audience :: Developers
16+
Programming Language :: Python :: 3.8
17+
Programming Language :: Python :: 3.9
18+
Topic :: Software Development
719

820
[flake8]
921
ignore = E203,E231,E701,W503,W504
1022
# E203,E231,E701 -> walrus
1123
# W503/504 -> line-break-before/after-binary-operator
12-
max-line-length = 119
13-
extend-exclude =
24+
max_line_length = 119
25+
extend_exclude =
1426
.github,
1527
.vscode,
1628
tests/fixtures,

0 commit comments

Comments
 (0)