Skip to content

Commit d73ed1c

Browse files
author
Zoran Simic
committed
Revert "Use trusted publishing, modernized linter setup"
This reverts commit 63a151f.
1 parent 63a151f commit d73ed1c

File tree

3 files changed

+36
-14
lines changed

3 files changed

+36
-14
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ jobs:
99
publish:
1010

1111
runs-on: ubuntu-latest
12-
environment: release
13-
permissions:
14-
id-token: write # mandatory for trusted publishing
1512

1613
steps:
1714
- uses: actions/checkout@v4
1815
- uses: actions/setup-python@v5
1916
with:
2017
python-version: "3.11"
2118

22-
- run: pip install -U pip setuptools wheel tox
19+
- run: pip install -U pip setuptools wheel twine 'tox<4'
2320
- run: tox -e py,docs,style
2421
- run: python setup.py sdist bdist_wheel
2522

26-
- name: Publish to PyPI
27-
uses: pypa/gh-action-pypi-publish@release/v1
23+
- name: Publish sdist and wheel
24+
env:
25+
TWINE_USERNAME: __token__
26+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
27+
run: twine upload --non-interactive dist/*

pyproject.toml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[build-system]
22
requires = ["setuptools", "wheel"]
3-
build-backend = "setuptools.build_meta"
43

54
[tool.ruff]
65
cache-dir = ".tox/.ruff_cache"
@@ -10,7 +9,7 @@ src = ["src", "tests"]
109
[tool.ruff.lint]
1110
extend-select = [
1211
"A", # flake8-builtins
13-
"ARG", # flake8-unused-arguments
12+
# "ARG", # flake8-unused-arguments
1413
"B", # flake8-bugbear
1514
"C4", # flake8-comprehensions
1615
"C90", # mccabe
@@ -34,16 +33,33 @@ extend-select = [
3433
"RET", # flake8-return
3534
"RUF", # ruff-specific
3635
"S", # flake8-bandit
37-
"SIM", # flake8-simplify
36+
# "SIM", # flake8-simplify
3837
"SLF", # flake8-self
3938
"SLOT", # flake8-slots
4039
"T10", # flake8-debugger
4140
"TID", # flake8-tidy-imports
4241
"TCH", # flake8-type-checking
43-
"TD", # flake8-todos
42+
# "TD", # flake8-todos
4443
"TRY", # tryceratops
4544
"W", # pycodestyle warnings
4645
]
46+
ignore = [
47+
# TODO: gradually remove these (document all the things)
48+
"D100", # Missing docstring in public module
49+
"D101", # Missing docstring in public class
50+
"D102", # Missing docstring in public method
51+
"D103", # Missing docstring in public function
52+
"D104", # Missing docstring in public package
53+
"D105", # Missing docstring in magic method
54+
"D200", # One-line docstring should fit on one line with quotes
55+
"D205", # 1 blank line required between summary line and description
56+
"D400", # First line should end with a period
57+
# Not useful:
58+
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
59+
]
60+
61+
[tool.ruff.lint.flake8-builtins]
62+
builtins-ignorelist = ["bin", "compile"]
4763

4864
[tool.ruff.lint.isort]
4965
order-by-type = false
@@ -53,3 +69,8 @@ max-complexity = 14
5369

5470
[tool.ruff.lint.pydocstyle]
5571
convention = "numpy"
72+
73+
[tool.ruff.lint.per-file-ignores]
74+
"tests/*" = [
75+
"S", # No security checks for tests
76+
]

tox.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ setenv = COVERAGE_FILE={toxworkdir}/.coverage.{envname}
77
usedevelop = True
88
deps = -rrequirements.txt
99
-rtests/requirements.txt
10-
commands = pytest {posargs:-vv --cov=src/ --cov=tests/ --cov-report=xml tests/}
10+
commands = pytest {posargs:-vv --cov=src/ --cov-report=xml tests/}
1111

1212
[testenv:coverage]
1313
setenv = COVERAGE_FILE={toxworkdir}/.coverage
@@ -21,14 +21,15 @@ commands = coverage combine
2121
[testenv:style]
2222
skip_install = True
2323
deps = ruff
24-
commands = ruff check
24+
commands = ruff check --diff
25+
ruff check --output-format=full
2526
ruff format --diff
2627

2728
[testenv:reformat]
2829
skip_install = True
2930
deps = ruff
30-
commands = ruff check --fix
31-
ruff format
31+
commands = ruff check --fix {posargs:}
32+
ruff format {posargs:}
3233

3334
[testenv:docs]
3435
skip_install = True

0 commit comments

Comments
 (0)