Skip to content

Commit

Permalink
Merge pull request #69 from cdce8p/dev
Browse files Browse the repository at this point in the history
Release v0.3.4
  • Loading branch information
cdce8p authored Jul 20, 2021
2 parents 15529b2 + 0f9a098 commit b6d3d14
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 57 deletions.
4 changes: 3 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
labels:
- "dependency"
assignees:
- "cdce8p"
open-pull-requests-limit: 10
rebase-strategy: "disabled"

- package-ecosystem: "github-actions"
directory: "/"
Expand All @@ -19,3 +20,4 @@ updates:
assignees:
- "cdce8p"
open-pull-requests-limit: 10
rebase-strategy: "disabled"
28 changes: 14 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Generate partial Python venv restore key
Expand All @@ -37,7 +37,7 @@ jobs:
'requirements_test_pre_commit.txt') }}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
path: venv
key: >-
Expand All @@ -60,7 +60,7 @@ jobs:
hashFiles('.pre-commit-config.yaml') }}"
- name: Restore pre-commit environment
id: cache-precommit
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: >-
Expand All @@ -82,12 +82,12 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
Expand All @@ -99,7 +99,7 @@ jobs:
exit 1
- name: Restore pre-commit environment
id: cache-precommit
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: ${{ runner.os }}-${{ needs.prepare-base.outputs.pre-commit-key }}
Expand All @@ -123,12 +123,12 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
Expand All @@ -153,12 +153,12 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
python-version: ${{ matrix.python-version }}
- name: Generate partial Python venv restore key
Expand All @@ -198,7 +198,7 @@ jobs:
'requirements_test_pre_commit.txt') }}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
path: venv
key: >-
Expand Down Expand Up @@ -228,12 +228,12 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].4
uses: actions/[email protected].6
with:
path: venv
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
run: |
python -m pip install -U pip twine wheel
python -m pip install -U "setuptools>=56.0.0"
python -m pip install -U "setuptools>=57.1.0"
- name: Build distributions
run: |
python setup.py sdist bdist_wheel
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.12.0
rev: v2.21.2
hooks:
- id: pyupgrade
args: [--py38-plus]
exclude: &fixtures ^tests/fixtures/.+\.py$
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
rev: 3.9.2
hooks:
- id: flake8
files: ^(python_typing_update|script|tests)/.+\.py$
exclude: *fixtures
- repo: https://github.com/PyCQA/isort
rev: 5.8.0
rev: 5.9.2
hooks:
- id: isort
exclude: *fixtures
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"python.linting.flake8Enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.mypyEnabled": true,
"python.testing.pytestArgs": [],
"python.testing.pytestArgs": [
"--disable-warnings"
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true,
Expand Down
16 changes: 10 additions & 6 deletions pylintrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[MASTER]
ignore=
load-plugins =
pylint.extensions.typing,

[BASIC]
good-names=
good-names =
i,j,k,_,fp,it,ex,logger

[MESSAGE CONTROL]
# Reasons disabled:
# superfluous-parens - used with :=
# duplicate-code - for scripts acceptable
disable=
disable =
superfluous-parens,
missing-module-docstring,
missing-class-docstring,
missing-function-docstring,
missing-docstring,
too-many-instance-attributes,
too-many-return-statements,
too-many-locals,
Expand All @@ -25,7 +25,11 @@ disable=
duplicate-code,

[FORMAT]
max-line-length=119
max-line-length = 119

[REPORTS]
score = no

[TYPING]
py-version = 3.8
runtime-typing = no
4 changes: 2 additions & 2 deletions python_typing_update/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from enum import Flag, auto
from typing import NamedTuple

version = (0, 3, 3)
dev_version = None # Set to `None` for release
version = (0, 3, 4)
dev_version = 0 # Set to `None` for release

version_str = '.'.join(map(str, version))
if dev_version is not None:
Expand Down
8 changes: 4 additions & 4 deletions python_typing_update/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async def async_load_file(filename: str) -> tuple[str, FileAttributes]:
active_tasks -= 1
return filename, FileAttributes(file_status, imports_set)

results = await asyncio.gather(*[async_load_file(file_) for file_ in filenames])
results = await asyncio.gather(*(async_load_file(file_) for file_ in filenames))
return dict(results)


Expand Down Expand Up @@ -177,7 +177,7 @@ async def async_run(args: argparse.Namespace) -> int:
builtins.print = lambda *args, **kwargs: None

return_values = await asyncio.gather(
*[typing_update(loop, filename, args, attrs.status) for filename, attrs in filenames.items()])
*(typing_update(loop, filename, args, attrs.status) for filename, attrs in filenames.items()))
for status, filename in return_values:
if status == 0:
files_updated.append(filename)
Expand All @@ -204,10 +204,10 @@ async def async_run(args: argparse.Namespace) -> int:
return 0

files_updated_set: set[str] = set(files_updated)
files_with_comments = sorted([
files_with_comments = sorted(
filename for filename, attrs in filenames.items()
if FileStatus.COMMENT in attrs.status and filename in files_updated_set
])
)
files_imports_changed: list[str] = []
for file_, attrs in (await async_load_files(args, files_updated_set, check_comments=False)).items():
import_diff = filenames[file_].imports.difference(attrs.imports)
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aiofiles==0.6.0
aiofiles==0.7.0
autoflake==1.4
isort==5.8.0
pyupgrade==2.12.0
reorder-python-imports==2.4.0
isort==5.9.2
pyupgrade==2.21.2
reorder-python-imports==2.5.0
2 changes: 1 addition & 1 deletion requirements_black.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
black==20.8b1
black==21.7b0
11 changes: 6 additions & 5 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-r requirements_test_pre_commit.txt
mypy==0.812
pre-commit==2.12.0
pylint==2.7.4
pytest==6.2.3
pytest-asyncio==0.14.0
mypy==0.910
pre-commit==2.13.0
pylint==2.9.3
pytest==6.2.4
pytest-asyncio==0.15.1
types-aiofiles==0.1.7
6 changes: 3 additions & 3 deletions requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flake8==3.9.0
isort==5.8.0
pyupgrade==2.12.0
flake8==3.9.2
isort==5.9.2
pyupgrade==2.21.2
17 changes: 13 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@ classifier =
Programming Language :: Python :: 3.9
Topic :: Software Development

[options]
packages = find:
python_requires = >=3.8,<3.10

[options.packages.find]
include =
python_typing_update*

[options.entry_points]
console_scripts =
python-typing-update = python_typing_update.__main__:main

[flake8]
ignore = E203,E231,E701,W503,W504
# E203,E231,E701 -> walrus
# W503/504 -> line-break-before/after-binary-operator
max_line_length = 119
extend_exclude =
.github,
Expand All @@ -32,7 +41,7 @@ extend_exclude =
testpaths = tests
norecursedirs = fixtures
console_output_style = count
log_level=NOTSET
log_level = NOTSET

[tool:isort]
# https://github.com/PyCQA/isort/wiki/isort-Settings
Expand Down
7 changes: 0 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,8 @@ def load_requirements_file(filename: str) -> list[str]:

setup(
version=version_str,
packages=['python_typing_update'],
python_requires='>=3.8, <3.10',
install_requires=load_requirements_file('requirements.txt'),
extras_require={
'black': load_requirements_file('requirements_black.txt'),
},
entry_points={
'console_scripts': [
'python-typing-update = python_typing_update.__main__:main',
],
},
)

0 comments on commit b6d3d14

Please sign in to comment.