Skip to content

Commit d1fd493

Browse files
authored
Cleanup inner project (#28)
1 parent 8a7338b commit d1fd493

File tree

17 files changed

+59
-63
lines changed

17 files changed

+59
-63
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
30-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
30+
python-version: ['3.8', '3.9', '3.10', '3.11']
3131

3232
steps:
3333
- uses: actions/checkout@v2

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ repos:
4444
hooks:
4545
- id: reorder-python-imports
4646
- repo: https://github.com/asottile/setup-cfg-fmt
47-
rev: v1.20.0
47+
rev: v2.2.0
4848
hooks:
4949
- id: setup-cfg-fmt
5050
exclude: |
@@ -118,6 +118,10 @@ repos:
118118
]
119119
args: [--wrap, "88"]
120120
files: (README\.md)
121+
exclude: |
122+
(?x)^(
123+
{{cookiecutter.project_slug}}/README.md
124+
)$
121125
- repo: https://github.com/executablebooks/mdformat
122126
rev: 0.7.16
123127
hooks:

docs/docs_environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- nodefaults
44

55
dependencies:
6-
- python >= 3.7
6+
- python >= 3.8
77
- pip >=21.1
88
- setuptools_scm
99
- toml

docs/source/changes.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
This is a record of all past cookiecutter-pytask-project releases and what went into
44
them in reverse chronological order.
55

6-
## 1.2.2 - 2022-05-31
6+
## 1.3.0 - 2022-11-20
77

88
- {pull}`22` removes sphinx-click and renames docs environment to
99
`docs_environment.yml`.
10+
- {pull}`25` adds docsformatter.
11+
- {pull}`26` uses a better approach to set the initial branch.
12+
- {pull}`27` adds support for Python 3.11.
13+
- {pull}`28` does some cleaning and deprecates support for Python 3.7. Thanks
14+
{user}`timmens`!
1015

1116
## 1.2.1 - 2022-05-13
1217

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ channels:
55
- nodefaults
66

77
dependencies:
8-
- python >=3.7
8+
- python >=3.8
99
- pip >=21.1
1010
- setuptools_scm
1111
- toml

hooks/pre_gen_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]*$"
55
ENVIRON_REGEX = r"^[-_a-zA-Z0-9]*$"
66
PYTHONVERSION_REGEX = r"^(3\.(1[0-9]|[7-9])(\.[0-9]{1,2})?)$"
7-
PYTHONVERSION_MIN = "3.7"
7+
PYTHONVERSION_MIN = "3.8"
88

99
EXCEPTION_MSG_MODULE_NAME = """
1010
ERROR: The project slug ({module_name}) is not a valid Python module name.

setup.cfg

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ classifiers =
1919
Operating System :: POSIX
2020
Programming Language :: Python :: 3
2121
Programming Language :: Python :: 3 :: Only
22-
Programming Language :: Python :: 3.7
23-
Programming Language :: Python :: 3.8
24-
Programming Language :: Python :: 3.9
25-
Programming Language :: Python :: 3.10
2622
Topic :: Scientific/Engineering
2723
Topic :: Software Development :: Build Tools
2824
project_urls =
@@ -32,7 +28,7 @@ project_urls =
3228
Tracker = https://github.com/pytask-dev/cookiecutter-pytask-project/issues
3329

3430
[options]
35-
python_requires = >=3.7
31+
python_requires = >=3.8
3632

3733
[check-manifest]
3834
ignore =

tests/test_cookie.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
import pytest
66

77

8+
_PYTHON_VERSION = ".".join(map(str, sys.version_info[:2]))
9+
10+
811
@pytest.mark.end_to_end
912
def test_bake_project(cookies):
10-
major, minor = sys.version_info[:2]
11-
python_version = f"{major}.{minor}"
12-
1313
result = cookies.bake(
14-
extra_context={"project_slug": "helloworld", "python_version": python_version}
14+
extra_context={"project_slug": "helloworld", "python_version": _PYTHON_VERSION}
1515
)
1616

1717
assert result.exit_code == 0
@@ -22,7 +22,12 @@ def test_bake_project(cookies):
2222

2323
@pytest.mark.end_to_end
2424
def test_remove_readthedocs(cookies):
25-
result = cookies.bake(extra_context={"add_readthedocs": "no"})
25+
result = cookies.bake(
26+
extra_context={
27+
"add_readthedocs": "no",
28+
"python_version": ".".join(map(str, sys.version_info[:2])),
29+
}
30+
)
2631

2732
rtd_config = result.project_path.joinpath(".readthedocs.yaml")
2833
readme = result.project_path.joinpath("README.md").read_text()
@@ -36,7 +41,9 @@ def test_remove_readthedocs(cookies):
3641

3742
@pytest.mark.end_to_end
3843
def test_remove_github_actions(cookies):
39-
result = cookies.bake(extra_context={"add_github_actions": "no"})
44+
result = cookies.bake(
45+
extra_context={"add_github_actions": "no", "python_version": _PYTHON_VERSION}
46+
)
4047

4148
ga_config = result.project_path.joinpath(".github", "workflows", "main.yml")
4249
readme = result.project_path.joinpath("README.md").read_text()
@@ -50,7 +57,9 @@ def test_remove_github_actions(cookies):
5057

5158
@pytest.mark.end_to_end
5259
def test_remove_tox(cookies):
53-
result = cookies.bake(extra_context={"add_tox": "no"})
60+
result = cookies.bake(
61+
extra_context={"add_tox": "no", "python_version": _PYTHON_VERSION}
62+
)
5463

5564
ga_config = result.project_path.joinpath(".github", "workflows", "main.yml")
5665
tox = result.project_path.joinpath("tox.ini")
@@ -64,7 +73,12 @@ def test_remove_tox(cookies):
6473

6574
@pytest.mark.end_to_end
6675
def test_remove_license(cookies):
67-
result = cookies.bake(extra_context={"open_source_license": "Not open source"})
76+
result = cookies.bake(
77+
extra_context={
78+
"open_source_license": "Not open source",
79+
"python_version": _PYTHON_VERSION,
80+
}
81+
)
6882

6983
license_ = result.project_path.joinpath("LICENSE")
7084

@@ -83,6 +97,7 @@ def test_check_conda_environment_creation_and_run_all_checks(cookies):
8397
"conda_environment_name": "__test__",
8498
"make_initial_commit": "yes",
8599
"create_conda_environment_at_finish": "yes",
100+
"python_version": _PYTHON_VERSION,
86101
}
87102
)
88103

tox.ini

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@ commands =
3232
sphinx-build -T -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
3333
- sphinx-build -T -b linkcheck -d {envtmpdir}/doctrees . {envtmpdir}/linkcheck
3434

35-
36-
[doc8]
37-
ignore = D004
38-
ignore-path =
39-
docs/build
40-
ignore-path-errors =
41-
{{cookiecutter.project_slug}}/README.rst;D000,
42-
{{cookiecutter.project_slug}}/docs/source/changes.rst;D000
43-
max-line-length = 88
44-
4535
[flake8]
4636
docstring-convention = numpy
4737
ignore =

{{cookiecutter.project_slug}}/.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
30-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
30+
python-version: ['3.8', '3.9', '3.10', '3.11']
3131

3232
steps:
3333
- uses: actions/checkout@v2

0 commit comments

Comments
 (0)