Skip to content

Commit 288ea3e

Browse files
0.3.2 (#73)
* Update CI * Ruff fixes
1 parent fd073f3 commit 288ea3e

30 files changed

+107
-77
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ max-line-length = 120
2525

2626
exclude =
2727
__init__.py
28+
docs/conf.py
2829

2930
.git,
3031
.tox,

.github/workflows/publish-pypi.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ jobs:
77
build-n-publish:
88
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
99
runs-on: ubuntu-latest
10+
environment: release
11+
permissions:
12+
# IMPORTANT: this permission is mandatory for trusted publishing
13+
id-token: write
1014

1115
steps:
1216
- uses: actions/checkout@v3
1317
with:
14-
ref: master
18+
ref: main
1519
- name: Set up Python 3.10
1620
uses: actions/setup-python@v4
1721
with:
@@ -27,7 +31,4 @@ jobs:
2731
python setup.py sdist bdist_wheel
2832
2933
- name: Publish distribution to PyPI
30-
uses: pypa/gh-action-pypi-publish@master
31-
with:
32-
user: __token__
33-
password: ${{ secrets.pypi_api_key }}
34+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/run_tox.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ jobs:
1313
python-version: '3.10'
1414
- uses: pre-commit/[email protected]
1515

16-
1716
test:
1817
needs: pre-commit
1918
runs-on: ubuntu-latest
2019
strategy:
2120
max-parallel: 4
2221
matrix:
23-
python-version: ['3.8', '3.9', '3.10', '3.11']
22+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
2423

2524
steps:
2625
- uses: actions/checkout@v3

.pre-commit-config.yaml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
repos:
2-
32
- repo: https://github.com/pre-commit/pre-commit-hooks
43
rev: v4.5.0
54
hooks:
5+
- id: check-ast
6+
- id: check-builtin-literals
7+
- id: check-docstring-first
8+
- id: check-merge-conflict
9+
- id: check-toml
610
- id: check-yaml
11+
- id: debug-statements
712
- id: end-of-file-fixer
813
- id: trailing-whitespace
914

@@ -14,23 +19,12 @@ repos:
1419
- id: ruff
1520
# - id: ruff-format
1621

17-
- repo: https://github.com/PyCQA/flake8
18-
rev: '6.1.0'
22+
- repo: https://github.com/pre-commit/pygrep-hooks
23+
rev: v1.10.0
1924
hooks:
20-
- id: flake8
21-
additional_dependencies:
22-
- flake8-bugbear==23.9.16
23-
- flake8-comprehensions==3.14.0
24-
- flake8-pytest-style==1.7.2
25-
- pep8-naming==0.13.3
25+
- id: rst-backticks
2626

2727
- repo: meta
2828
hooks:
2929
- id: check-hooks-apply
3030
- id: check-useless-excludes
31-
32-
- repo: https://github.com/asottile/pyupgrade
33-
rev: v3.15.0
34-
hooks:
35-
- id: pyupgrade
36-
args: ["--py38-plus"]
File renamed without changes.

.ruff.toml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ select = [
3636
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf
3737
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
3838

39-
# "PL", # https://docs.astral.sh/ruff/rules/#pylint-pl
40-
# "FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb
39+
"PL", # https://docs.astral.sh/ruff/rules/#pylint-pl
4140
]
4241

4342
ignore = [
44-
"RET501" # https://docs.astral.sh/ruff/rules/unnecessary-return-none/#unnecessary-return-none-ret501
43+
"A003", # https://docs.astral.sh/ruff/rules/builtin-attribute-shadowing/
44+
"RET501", # https://docs.astral.sh/ruff/rules/unnecessary-return-none/#unnecessary-return-none-ret501
45+
"TRY400", # https://docs.astral.sh/ruff/rules/error-instead-of-exception/
46+
"PLR1711", # https://docs.astral.sh/ruff/rules/useless-return/
4547
]
4648

4749

@@ -50,15 +52,24 @@ ignore = [
5052
quote-style = "single"
5153

5254

53-
[lint.isort]
54-
known-local-folder = ["easyconfig"]
55-
known-first-party = ["tests", "helper"]
55+
[lint.per-file-ignores]
56+
"docs/*" = [
57+
"A001", # A001 Variable `copyright` is shadowing a Python builtin
58+
"E402", # E402 Module level import not at top of file
59+
"INP001", # INP001 File `FILE_NAME` is part of an implicit namespace package. Add an `__init__.py`.
60+
]
5661

62+
"tests/*" = [
63+
"INP001", # INP001 File `FILE_NAME` is part of an implicit namespace package. Add an `__init__.py`.
64+
"ISC002", # ISC002 Implicitly concatenated string literals over multiple lines
65+
"PLR2004", # PLR2004 Magic value used in comparison, consider replacing 5 with a constant variable
66+
]
5767

58-
[lint.flake8-builtins]
59-
builtins-ignorelist = ["id"]
68+
"setup.py" = ["PTH123"]
69+
"src/easyconfig/yaml/from_model.py" = ["PLR0911"] # PLR0911 Too many return statements (7 > 6)
6070

6171

62-
[lint.per-file-ignores]
63-
"docs/conf.py" = ["INP001", "A001"]
64-
"setup.py" = ["PTH123"]
72+
73+
[lint.isort]
74+
# https://docs.astral.sh/ruff/settings/#isort-lines-after-imports
75+
lines-after-imports = 2

docs/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@
1313
import sys
1414
from pathlib import Path
1515

16+
1617
src_folder = Path(__file__).parent.with_name('src')
1718
assert src_folder.is_dir()
1819

1920
# required for autodoc
2021
sys.path.insert(0, str(src_folder))
2122

22-
import easyconfig # noqa: E402
23+
import easyconfig
24+
2325

2426
# -- Project information -----------------------------------------------------
2527
project = 'easyconfig'
26-
copyright = '2023, spacemanspiff2007'
28+
copyright = '2024, spacemanspiff2007'
2729
author = 'spacemanspiff2007'
2830

2931
# The full version, including alpha/beta/rc tags

docs/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Packages required to build the documentation
22
sphinx == 7.2.6
3-
sphinx-autodoc-typehints == 1.25.0
4-
sphinx_rtd_theme == 1.3.0
5-
sphinx-exec-code == 0.10
3+
sphinx-autodoc-typehints == 1.25.2
4+
sphinx_rtd_theme == 2.0.0
5+
sphinx-exec-code == 0.12

readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ That way the users can have some guidance how to change the program behaviour.
4040
It's possible to use environment variable or files for expansion. Easyconfig will load all values
4141

4242
# Changelog
43+
#### 0.3.2 (2024-01-10)
44+
- Updated CI and code linters
45+
4346
#### 0.3.1 (2023-11-10)
4447
- Updated dependencies and code linters
4548

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
-r requirements_setup.txt
33

44
# testing dependencies
5-
pytest >= 7.4, < 8
6-
pre-commit >= 3.5, < 4
5+
pytest == 7.4.4
6+
pre-commit == 3.5.0
77

88
# linter
9-
ruff >= 0.1.5, < 0.2
9+
ruff == 0.1.11

0 commit comments

Comments
 (0)