Skip to content

Commit fc696e7

Browse files
authored
🔧 MAINTAIN: Move from setuptools to flit (#74)
1 parent 1245cac commit fc696e7

File tree

7 files changed

+92
-125
lines changed

7 files changed

+92
-125
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
push:
88
branches: [main]
99
tags:
10-
- 'v*'
10+
- "v[0-9]+.[0-9]+.[0-9]+*"
1111
pull_request:
1212

1313
jobs:
@@ -71,12 +71,12 @@ jobs:
7171
uses: actions/setup-python@v2
7272
with:
7373
python-version: 3.8
74-
- name: Build package
74+
- name: install flit
7575
run: |
76-
pip install wheel
77-
python setup.py sdist bdist_wheel
78-
- name: Publish
79-
uses: pypa/gh-action-pypi-publish@v1.1.0
80-
with:
81-
user: __token__
82-
password: ${{ secrets.PYPI_KEY }}
76+
pip install flit~=3.4
77+
- name: Build and publish
78+
run: |
79+
flit publish
80+
env:
81+
FLIT_USERNAME: __token__
82+
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}

.pre-commit-config.yaml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,20 @@ exclude: >
1111
repos:
1212

1313
- repo: https://github.com/pre-commit/pre-commit-hooks
14-
rev: v4.1.0
14+
rev: v4.2.0
1515
hooks:
1616
- id: check-json
1717
- id: check-yaml
1818
- id: end-of-file-fixer
1919
- id: trailing-whitespace
2020

21-
- repo: https://github.com/mgedmin/check-manifest
22-
rev: "0.47"
23-
hooks:
24-
- id: check-manifest
25-
args: [--no-build-isolation]
26-
additional_dependencies: [setuptools>=46.4.0]
27-
2821
- repo: https://github.com/pycqa/isort
2922
rev: 5.10.1
3023
hooks:
3124
- id: isort
3225

3326
- repo: https://github.com/psf/black
34-
rev: 22.1.0
27+
rev: 22.3.0
3528
hooks:
3629
- id: black
3730

@@ -42,12 +35,7 @@ repos:
4235
additional_dependencies: [flake8-bugbear==21.3.1]
4336

4437
- repo: https://github.com/pre-commit/mirrors-mypy
45-
rev: v0.931
38+
rev: v0.942
4639
hooks:
4740
- id: mypy
4841
additional_dependencies: [attrs]
49-
50-
- repo: https://github.com/asottile/setup-cfg-fmt
51-
rev: v1.20.0
52-
hooks:
53-
- id: setup-cfg-fmt

MANIFEST.in

Lines changed: 0 additions & 16 deletions
This file was deleted.

pyproject.toml

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,80 @@
11
[build-system]
2-
requires = ["setuptools>=46.4.0", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["flit_core >=3.4,<4"]
3+
build-backend = "flit_core.buildapi"
4+
5+
[project]
6+
name = "sphinx_external_toc"
7+
dynamic = ["version"]
8+
description = "A sphinx extension that allows the site-map to be defined in a single YAML file."
9+
readme = "README.md"
10+
authors = [{name = "Chris Sewell", email = "chrisj_sewell@hotmail.com"}]
11+
license = {file = "LICENSE"}
12+
classifiers = [
13+
"Development Status :: 3 - Alpha",
14+
"Framework :: Sphinx :: Extension",
15+
"Intended Audience :: Developers",
16+
"License :: OSI Approved :: MIT License",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.6",
19+
"Programming Language :: Python :: 3.7",
20+
"Programming Language :: Python :: 3.8",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: Implementation :: CPython",
23+
"Topic :: Software Development :: Libraries :: Python Modules",
24+
"Topic :: Text Processing :: Markup",
25+
]
26+
keywords = ["sphinx","extension", "toc"]
27+
requires-python = "~=3.6"
28+
dependencies = [
29+
"attrs>=20.3,<22",
30+
"click>=7.1,<9",
31+
"pyyaml",
32+
"sphinx>=3,<5",
33+
]
34+
35+
[project.urls]
36+
Homepage = "https://github.com/executablebooks/sphinx-external-toc"
37+
Documentation = "https://sphinx-external-toc.readthedocs.io"
38+
39+
[project.entry-points]
40+
"jb.cmdline" = {toc = "sphinx_external_toc.cli:main"}
41+
42+
[project.optional-dependencies]
43+
code_style = ["pre-commit~=2.12"]
44+
rtd = [
45+
"myst-parser~=0.15.0",
46+
"sphinx-book-theme>=0.0.36",
47+
]
48+
testing = [
49+
"coverage",
50+
"pytest>=3.6,<4",
51+
"pytest-cov",
52+
"pytest-regressions",
53+
]
54+
55+
[project.scripts]
56+
sphinx-etoc = "sphinx_external_toc.cli:main"
57+
58+
[tool.flit.sdist]
59+
exclude = [
60+
"docs/",
61+
"tests/",
62+
]
63+
64+
[tool.mypy]
65+
show_error_codes = true
66+
warn_unused_ignores = true
67+
warn_redundant_casts = true
68+
no_implicit_optional = true
69+
strict_equality = true
70+
71+
[[tool.mypy.overrides]]
72+
module = ["docutils.*"]
73+
ignore_missing_imports = true
74+
75+
[[tool.mypy.overrides]]
76+
module = ["yaml.*"]
77+
ignore_missing_imports = true
478

579
[tool.isort]
680
profile = "black"

setup.cfg

Lines changed: 0 additions & 77 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

tox.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ commands =
2929
clean: rm -rf docs/_build
3030
sphinx-build -nW --keep-going -b {posargs:html} docs/ docs/_build/{posargs:html}
3131
commands_post = echo "open docs/_build/html/index.html"
32+
33+
[flake8]
34+
max-line-length = 100
35+
extend-ignore = E203

0 commit comments

Comments
 (0)