Skip to content

Commit

Permalink
feat: drop support for Python 3.6 (andreoliwa#439)
Browse files Browse the repository at this point in the history
* style(pre-commit): enforce --py37plus on pyupgrade
* ci: run prettier to fix bumpversion files
* build: remove pinned jedi dependency
* build: pin pytest-socket
* build: use poetry-core
  • Loading branch information
andreoliwa authored Jan 14, 2022
1 parent 8a1d2bd commit a02e0ce
Show file tree
Hide file tree
Showing 25 changed files with 130 additions and 303 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# ubuntu-latest is being moved from ubuntu-18.04 to ubuntu-20.04
# See https://github.com/actions/virtual-environments/issues/1816
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
runs-on: ${{ matrix.os }}
env:
PYTHONUNBUFFERED: 1
Expand Down
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ repos:
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
Expand Down Expand Up @@ -102,10 +103,8 @@ repos:
rev: v0.931
hooks:
- id: mypy
args: [
# https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-show-error-codes
--show-error-codes,
]
# https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-show-error-codes
args: [--show-error-codes]
# Install additional types to fix new warnings that appeared on v0.910:
# https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
# "using --install-types is problematic"
Expand Down
18 changes: 8 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# [0.30.0](https://github.com/andreoliwa/nitpick/compare/v0.29.0...v0.30.0) (2022-01-14)


### Bug Fixes

* style override on Windows ([#422](https://github.com/andreoliwa/nitpick/issues/422)) ([e7d2897](https://github.com/andreoliwa/nitpick/commit/e7d2897096df3ab868c97b68d915191b488e83bf))
* use current dir; don't climb dirs to find the project root ([#421](https://github.com/andreoliwa/nitpick/issues/421)) ([3c82e8c](https://github.com/andreoliwa/nitpick/commit/3c82e8c4d019a5b25e1c0d9db1792f72cf800305))

- style override on Windows ([#422](https://github.com/andreoliwa/nitpick/issues/422)) ([e7d2897](https://github.com/andreoliwa/nitpick/commit/e7d2897096df3ab868c97b68d915191b488e83bf))
- use current dir; don't climb dirs to find the project root ([#421](https://github.com/andreoliwa/nitpick/issues/421)) ([3c82e8c](https://github.com/andreoliwa/nitpick/commit/3c82e8c4d019a5b25e1c0d9db1792f72cf800305))

### Features

* default pre-commit hook now runs "nitpick fix" ([cb4c242](https://github.com/andreoliwa/nitpick/commit/cb4c242607c6810c629dc7f5604920c1b64a070e))
* **json:** autofix JSON files ([#429](https://github.com/andreoliwa/nitpick/issues/429)) ([4b58a03](https://github.com/andreoliwa/nitpick/commit/4b58a0380f88b01c99945817e7ff9b595ea362aa))
* nitpick init adds a [tool.nitpick] section ([36f4065](https://github.com/andreoliwa/nitpick/commit/36f4065483b1ec4308bc28b815c82aa0abac104c))
* **yaml:** autofix .pre-commit-config.yaml (note: style changed!) ([#434](https://github.com/andreoliwa/nitpick/issues/434)) ([352b53d](https://github.com/andreoliwa/nitpick/commit/352b53d574e49ca683666fd40de3462d1396e575))
* **yaml:** autofix GitHub Workflow files ([#437](https://github.com/andreoliwa/nitpick/issues/437)) ([6af77c4](https://github.com/andreoliwa/nitpick/commit/6af77c4293d8f964ccd249626d47c82440e6412f))
* **yaml:** autofix YAML files ([#431](https://github.com/andreoliwa/nitpick/issues/431)) ([d8cc4b1](https://github.com/andreoliwa/nitpick/commit/d8cc4b1e80366d475c08316c54dc35393b4430dd))
- default pre-commit hook now runs "nitpick fix" ([cb4c242](https://github.com/andreoliwa/nitpick/commit/cb4c242607c6810c629dc7f5604920c1b64a070e))
- **json:** autofix JSON files ([#429](https://github.com/andreoliwa/nitpick/issues/429)) ([4b58a03](https://github.com/andreoliwa/nitpick/commit/4b58a0380f88b01c99945817e7ff9b595ea362aa))
- nitpick init adds a [tool.nitpick] section ([36f4065](https://github.com/andreoliwa/nitpick/commit/36f4065483b1ec4308bc28b815c82aa0abac104c))
- **yaml:** autofix .pre-commit-config.yaml (note: style changed!) ([#434](https://github.com/andreoliwa/nitpick/issues/434)) ([352b53d](https://github.com/andreoliwa/nitpick/commit/352b53d574e49ca683666fd40de3462d1396e575))
- **yaml:** autofix GitHub Workflow files ([#437](https://github.com/andreoliwa/nitpick/issues/437)) ([6af77c4](https://github.com/andreoliwa/nitpick/commit/6af77c4293d8f964ccd249626d47c82440e6412f))
- **yaml:** autofix YAML files ([#431](https://github.com/andreoliwa/nitpick/issues/431)) ([d8cc4b1](https://github.com/andreoliwa/nitpick/commit/d8cc4b1e80366d475c08316c54dc35393b4430dd))

# [0.29.0](https://github.com/andreoliwa/nitpick/compare/v0.28.0...v0.29.0) (2021-11-08)

Expand Down
7 changes: 5 additions & 2 deletions ci-prepare-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ set -e

VERSION=$1
bumpversion --allow-dirty --no-commit --no-tag --new-version $VERSION patch
cat pyproject.toml
cat /home/runner/work/nitpick/nitpick/pyproject.toml

# Clean up the files touched by bumpversion
pre-commit run --all-files end-of-file-fixer
pre-commit run --all-files trailing-whitespace
pre-commit run --all-files prettier

rm -rf dist/
poetry build

# Hide the password
set +x
# TODO: ci: use poetry publish instead of twine
twine upload --verbose --disable-progress-bar --skip-existing --password $TWINE_TEST_PASSWORD -r testpypi dist/*
18 changes: 3 additions & 15 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,6 @@ Contents of `resources/python/310.toml <https://github.com/andreoliwa/nitpick/bl
["pyproject.toml".tool.poetry.dependencies]
python = "^3.10"
.. _example-python-3-6:

Python 3.6
----------

Contents of `resources/python/36.toml <https://github.com/andreoliwa/nitpick/blob/v0.30.0/resources/python/36.toml>`_:

.. code-block:: toml
["pyproject.toml".tool.poetry.dependencies]
python = "^3.6.1"
.. _example-python-3-7:

Python 3.7
Expand Down Expand Up @@ -390,7 +378,7 @@ Contents of `resources/python/github-workflow.toml <https://github.com/andreoliw
[".github/workflows/python.yaml".jobs.build.strategy.matrix]
os = ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version = ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version = ["3.7", "3.8", "3.9", "3.10"]
[".github/workflows/python.yaml".jobs.build]
name = "${{ matrix.python-version }} ${{ matrix.os }}"
Expand Down Expand Up @@ -452,6 +440,7 @@ Contents of `resources/python/hooks.toml <https://github.com/andreoliwa/nitpick/
[[".pre-commit-config.yaml".repos.hooks]]
id = "pyupgrade"
args = ["--py37-plus"]
.. _example-ipython:

Expand Down Expand Up @@ -683,8 +672,7 @@ Contents of `resources/python/stable.toml <https://github.com/andreoliwa/nitpick
[".readthedocs.yml".python]
# ReadTheDocs still didn't upgrade to Python 3.9:
# Problem in your project's configuration. Invalid "python.version":
# expected one of (2, 2.7, 3, 3.5, 3.6, 3.7, 3.8, pypy3.5), got 3.9
# Problem in your project's configuration. Invalid "python.version"
version = "3.8"
.. _example-tox:
Expand Down
11 changes: 1 addition & 10 deletions docs/generate_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@
from sortedcontainers import SortedDict

from nitpick import PROJECT_NAME, __version__
from nitpick.constants import (
CONFIG_FILES,
DOT,
EDITOR_CONFIG,
PROJECT_OWNER,
PYLINTRC,
READ_THE_DOCS_URL,
SETUP_CFG,
)
from nitpick.constants import CONFIG_FILES, DOT, EDITOR_CONFIG, PROJECT_OWNER, PYLINTRC, READ_THE_DOCS_URL, SETUP_CFG
from nitpick.core import Nitpick
from nitpick.style.fetchers.github import GitHubURL

Expand Down Expand Up @@ -60,7 +52,6 @@
"any/commitlint.toml": "commitlint_",
"python/hooks.toml": "pre-commit_ hooks for Python",
"python/pylint.toml": "Pylint_",
"python/36.toml": "Python 3.6",
"python/37.toml": "Python 3.7",
"python/38.toml": "Python 3.8",
"python/39.toml": "Python 3.9",
Expand Down
4 changes: 2 additions & 2 deletions docs/ideas/yaml/contains.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[[".github/workflows/python.yaml".contains]]
__jmespath = "jobs.build.strategy.matrix"
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.6", "3.7", "3.8", "3.9", "3.10"]
"python-version" = ["3.7", "3.8", "3.9", "3.10"]

# 3. Same as item 4 on "jmespath-on-section.toml", but with a different syntax.
[[".github/workflows/python.yaml".contains]]
Expand Down Expand Up @@ -56,7 +56,7 @@ __yaml = "- uses: actions/checkout@v2"
[[".github/workflows/python.yaml".contains_sorted]]
__jmespath = "jobs.build.strategy.matrix"
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.6", "3.7", "3.8", "3.9", "3.10"]
"python-version" = ["3.7", "3.8", "3.9", "3.10"]

[[".github/workflows/python.yaml".contains_sorted]]
__jmespath = "jobs.build"
Expand Down
2 changes: 1 addition & 1 deletion docs/ideas/yaml/merge_lists/merged_style.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This should be the result of a parent style including all the styles in this directory
[".github/workflows/python.yaml".jobs.build.strategy.matrix]
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.6", "3.7", "3.8", "3.9", "3.10"]
"python-version" = ["3.7", "3.8", "3.9", "3.10"]
2 changes: 0 additions & 2 deletions docs/ideas/yaml/merge_lists/py36.toml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ But they might still be present in the `entry_points.txt plugin metadata <https:
.. code-block::
$ rg nitpick.plugins.setup ~/Library/Caches/pypoetry/
/Users/john.doe/Library/Caches/pypoetry/virtualenvs/nitpick-UU_pZ5zs-py3.6/lib/python3.6/site-packages/nitpick-0.24.1.dist-info/entry_points.txt
/Users/john.doe/Library/Caches/pypoetry/virtualenvs/nitpick-UU_pZ5zs-py3.7/lib/python3.7/site-packages/nitpick-0.24.1.dist-info/entry_points.txt
11:setup_cfg=nitpick.plugins.setup_cfg
Remove and recreate the virtualenv; this should fix it.
Expand Down
Loading

0 comments on commit a02e0ce

Please sign in to comment.