Skip to content

Commit 1cf8fca

Browse files
authored
Fix the CI, bump tools (#185)
1 parent fed33ae commit 1cf8fca

12 files changed

+168
-172
lines changed

.github/workflows/check.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ jobs:
6161
CI_RUN: "yes"
6262
DIFF_AGAINST: HEAD
6363
- name: Rename coverage report file
64-
run: import os; import sys; os.rename(f".tox/.coverage.{os.environ['TOXENV']}", f".tox/.coverage.{os.environ['TOXENV']}-{sys.platform}")
64+
run: |
65+
import os; import sys
66+
os.rename(f".tox/.coverage.{os.environ['TOXENV']}", f".tox/.coverage.{os.environ['TOXENV']}-{sys.platform}")
6567
shell: python
6668
- name: Upload coverage data
6769
uses: actions/upload-artifact@v3
@@ -134,7 +136,7 @@ jobs:
134136

135137
publish:
136138
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
137-
needs: [ check, coverage ]
139+
needs: [check, coverage]
138140
runs-on: ubuntu-22.04
139141
steps:
140142
- name: Setup python to build package

.markdownlint.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
MD013:
2+
code_blocks: false
3+
headers: false
4+
line_length: 120
5+
tables: false
6+
7+
MD046:
8+
style: fenced

.pre-commit-config.yaml

+34-16
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,65 @@ repos:
1111
- id: debug-statements
1212
- id: end-of-file-fixer
1313
- id: trailing-whitespace
14+
- repo: https://github.com/asottile/add-trailing-comma
15+
rev: v2.4.0
16+
hooks:
17+
- id: add-trailing-comma
18+
args: [--py36-plus]
1419
- repo: https://github.com/asottile/pyupgrade
1520
rev: v3.3.1
1621
hooks:
1722
- id: pyupgrade
18-
args: [ "--py36-plus" ]
23+
args: ["--py37-plus"]
1924
- repo: https://github.com/PyCQA/isort
20-
rev: v5.11.3
25+
rev: 5.11.4
2126
hooks:
2227
- id: isort
2328
- repo: https://github.com/psf/black
2429
rev: 22.12.0
2530
hooks:
2631
- id: black
27-
args: [ --safe ]
32+
args: [--safe]
2833
- repo: https://github.com/asottile/blacken-docs
2934
rev: v1.12.1
3035
hooks:
3136
- id: blacken-docs
32-
additional_dependencies: [ black==22.10 ]
37+
additional_dependencies: [black==22.12]
3338
- repo: https://github.com/pre-commit/pygrep-hooks
3439
rev: v1.9.0
3540
hooks:
3641
- id: rst-backticks
37-
- repo: https://github.com/asottile/setup-cfg-fmt
38-
rev: v2.2.0
39-
hooks:
40-
- id: setup-cfg-fmt
4142
- repo: https://github.com/tox-dev/tox-ini-fmt
4243
rev: "0.5.2"
4344
hooks:
4445
- id: tox-ini-fmt
45-
args: [ "-p", "fix_lint" ]
46+
args: ["-p", "fix"]
4647
- repo: https://github.com/PyCQA/flake8
4748
rev: 6.0.0
4849
hooks:
4950
- id: flake8
5051
additional_dependencies:
51-
- flake8-bugbear==22.10.27
52-
- flake8-comprehensions==3.10.1
53-
- flake8-pytest-style==1.6
54-
- flake8-spellcheck==0.28
55-
- flake8-unused-arguments==0.0.12
56-
- flake8-noqa==1.3
57-
- pep8-naming==0.13.2
52+
- flake8-bugbear==22.12.6
53+
- flake8-comprehensions==3.10.1
54+
- flake8-pytest-style==1.6
55+
- flake8-spellcheck==0.28
56+
- flake8-unused-arguments==0.0.12
57+
- flake8-noqa==1.3
58+
- pep8-naming==0.13.3
59+
- flake8-pyproject==1.2.2
60+
- repo: https://github.com/pre-commit/mirrors-prettier
61+
rev: "v2.7.1"
62+
hooks:
63+
- id: prettier
64+
additional_dependencies:
65+
66+
- "@prettier/[email protected]"
67+
args: ["--print-width=120", "--prose-wrap=always"]
68+
- repo: https://github.com/igorshubovych/markdownlint-cli
69+
rev: v0.32.2
70+
hooks:
71+
- id: markdownlint
72+
- repo: meta
73+
hooks:
74+
- id: check-hooks-apply
75+
- id: check-useless-excludes

docs/changelog.rst

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Changelog
22
=========
3+
v3.9.0 (2022-12-28)
4+
-------------------
5+
- Move build backend to ``hatchling`` :pr:`185 - by :user:`gaborbernat`.
36

47
v3.8.1 (2022-12-04)
58
-------------------

docs/conf.py

+7-35
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,22 @@
44

55
from filelock import __version__
66

7-
company = "tox-dev"
8-
name = "filelock"
9-
version = ".".join(__version__.split(".")[:2])
10-
release = __version__
7+
name, company = "filelock", "tox-dev"
8+
version, release = ".".join(__version__.split(".")[:2]), __version__
119
copyright = f"2014-{date.today().year}, {company}"
12-
1310
extensions = [
1411
"sphinx.ext.autodoc",
1512
"sphinx.ext.autosectionlabel",
13+
"sphinx.ext.viewcode",
1614
"sphinx.ext.extlinks",
1715
"sphinx.ext.intersphinx",
1816
"sphinx_autodoc_typehints",
1917
]
20-
21-
templates_path = []
22-
unused_docs = []
23-
source_suffix = ".rst"
24-
exclude_patterns = ["_build"]
25-
26-
master_doc = "index"
27-
pygments_style = "default"
28-
29-
project = name
30-
today_fmt = "%B %d, %Y"
31-
3218
html_theme = "furo"
33-
html_favicon = "logo.svg"
34-
html_logo = "logo.svg"
35-
html_theme_options = {
36-
"navigation_with_keys": True,
37-
}
38-
html_title = name
39-
html_last_updated_fmt = datetime.now().isoformat()
40-
41-
autoclass_content = "class"
42-
autodoc_member_order = "bysource"
43-
autodoc_default_options = {
44-
"member-order": "bysource",
45-
"undoc-members": True,
46-
"show-inheritance": True,
47-
}
48-
autodoc_typehints = "none"
49-
always_document_param_types = False
50-
typehints_fully_qualified = True
19+
html_title, html_last_updated_fmt = name, datetime.now().isoformat()
20+
pygments_style, pygments_dark_style = "sphinx", "monokai"
21+
autoclass_content, autodoc_member_order, autodoc_typehints = "class", "bysource", "none"
22+
autodoc_default_options = {"member-order": "bysource", "undoc-members": True, "show-inheritance": True}
5123
autosectionlabel_prefix_document = True
5224

5325
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

docs/logo.svg

+28-6
Loading

pyproject.toml

+65-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,74 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=65.6.3",
4-
"setuptools_scm>=7.0.5",
2+
build-backend = "hatchling.build"
3+
requires = ["hatchling>=1.11.1", "hatch-vcs>=0.3"]
4+
5+
[project]
6+
name = "filelock"
7+
description = "A platform independent file lock."
8+
readme = "README.md"
9+
license = "Unlicense"
10+
maintainers = [{ name = "Bernát Gábor", email = "[email protected]" }]
11+
urls.Documentation = "https://py-filelock.readthedocs.io"
12+
urls.Homepage = "https://github.com/tox-dev/py-filelock"
13+
urls.Source = "https://github.com/tox-dev/py-filelock"
14+
urls.Tracker = "https://github.com/tox-dev/py-filelock/issues"
15+
requires-python = ">=3.7"
16+
optional-dependencies.testing = [
17+
"covdefaults>=2.2.2",
18+
"coverage>=7.0.1",
19+
"pytest>=7.2",
20+
"pytest-cov>=4",
21+
"pytest-timeout>=2.1",
22+
]
23+
optional-dependencies.docs = ["furo>=2022.12.7", "sphinx>=5.3", "sphinx-autodoc-typehints>=1.19.5"]
24+
keywords = ["application", "cache", "directory", "log", "user"]
25+
classifiers = [
26+
"Development Status :: 5 - Production/Stable",
27+
"Intended Audience :: Developers",
28+
"License :: OSI Approved :: The Unlicense (Unlicense)",
29+
"Operating System :: OS Independent",
30+
"Programming Language :: Python",
31+
"Programming Language :: Python :: 3",
32+
"Programming Language :: Python :: 3 :: Only",
33+
"Topic :: Internet",
34+
"Topic :: Software Development :: Libraries",
35+
"Topic :: System",
536
]
6-
build-backend = 'setuptools.build_meta'
37+
dynamic = ["version"]
38+
39+
[tool.hatch]
40+
build.hooks.vcs.version-file = "src/filelock/version.py"
41+
build.targets.sdist.include = ["/src", "/tests"]
42+
version.source = "vcs"
43+
44+
[tool.coverage]
45+
html.show_contexts = true
46+
html.skip_covered = false
47+
paths.source = ["src", ".tox/*/lib/*/site-packages", ".tox\\*\\Lib\\site-packages", "**/src", "**\\src"]
48+
paths.other = [".", "*/py-filelock", "*\\py-filelock"]
49+
report.fail_under = 76
50+
run.parallel = true
51+
run.plugins = ["covdefaults"]
752

853
[tool.black]
954
line-length = 120
1055

1156
[tool.isort]
12-
line_length = 120
1357
profile = "black"
14-
known_first_party = ["filelock", "tests"]
58+
known_first_party = ["filelock"]
59+
60+
[tool.mypy]
61+
python_version = "3.11"
62+
show_error_codes = true
63+
strict = true
64+
overrides = [{ module = ["appdirs.*", "jnius.*"], ignore_missing_imports = true }]
65+
66+
[tool.pep8]
67+
max-line-length = "120"
1568

16-
[tool.setuptools_scm]
17-
write_to = "src/filelock/version.py"
69+
[tool.flake8]
70+
max-complexity = 22
71+
max-line-length = 120
72+
unused-arguments-ignore-abstract-functions = true
73+
noqa-require-code = true
74+
dictionaries = ["en_US", "python", "technical", "django"]

setup.cfg

-77
This file was deleted.

setup.py

-5
This file was deleted.

0 commit comments

Comments
 (0)