Skip to content

Commit 43bb2cc

Browse files
authored
🔧 MAINTAIN: Move from setuptools to flit for package build (#58)
1 parent 6a412a1 commit 43bb2cc

File tree

14 files changed

+87
-156
lines changed

14 files changed

+87
-156
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ jobs:
6868
uses: actions/setup-python@v2
6969
with:
7070
python-version: 3.8
71-
- name: Build package
71+
- name: install flit
7272
run: |
73-
pip install wheel
74-
python setup.py sdist bdist_wheel
75-
- name: Publish
76-
uses: pypa/gh-action-pypi-publish@v1.1.0
77-
with:
78-
user: __token__
79-
password: ${{ secrets.PYPI_KEY }}
73+
pip install flit~=3.4
74+
- name: Build and publish
75+
run: |
76+
flit publish
77+
env:
78+
FLIT_USERNAME: __token__
79+
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.0.1
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: 21.12b0
27+
rev: 22.3.0
3528
hooks:
3629
- id: black
3730

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

4437
- repo: https://github.com/pre-commit/mirrors-mypy
45-
rev: v0.910-1
38+
rev: v0.942
4639
hooks:
4740
- id: mypy
4841
additional_dependencies: []
4942

50-
- repo: https://github.com/asottile/setup-cfg-fmt
51-
rev: v1.20.0
52-
hooks:
53-
- id: setup-cfg-fmt
54-
5543
- repo: local
5644
hooks:
5745
- id: css

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22

33
python:
4-
version: "3"
4+
version: "3.8"
55
install:
66
- method: pip
77
path: .

MANIFEST.in

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

pyproject.toml

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,70 @@
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_design"
7+
dynamic = ["version"]
8+
description = "A sphinx extension for designing beautiful, view size responsive web components."
9+
authors = [{name = "Chris Sewell", email = "[email protected]"}]
10+
readme = "README.md"
11+
license = {file = "LICENSE"}
12+
classifiers = [
13+
"Development Status :: 4 - Beta",
14+
"Framework :: Sphinx :: Extension",
15+
"Intended Audience :: Developers",
16+
"License :: OSI Approved :: MIT License",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.7",
19+
"Programming Language :: Python :: 3.8",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: Implementation :: CPython",
22+
"Topic :: Software Development :: Libraries :: Python Modules",
23+
"Topic :: Text Processing :: Markup",
24+
"Topic :: Text Processing :: Markup :: Markdown",
25+
"Topic :: Text Processing :: Markup :: reStructuredText",
26+
]
27+
keywords = ["sphinx", "extension", "material design", "web components"]
28+
requires-python = ">=3.7"
29+
dependencies = ["sphinx>=3,<5"]
30+
31+
[project.urls]
32+
Homepage = "https://github.com/executablebooks/sphinx-design"
33+
Documentation = "https://sphinx-design.readthedocs.io"
34+
35+
[project.optional-dependencies]
36+
code_style = ["pre-commit~=2.12"]
37+
rtd = ["myst-parser~=0.17.0"]
38+
testing = [
39+
"myst-parser~=0.17.0",
40+
"pytest~=6.2",
41+
"pytest-cov",
42+
"pytest-regressions",
43+
]
44+
theme_furo = ["furo==2022.04.07"]
45+
theme_pydata = ["pydata-sphinx-theme~=0.8.1"]
46+
theme_rtd = ["sphinx-rtd-theme~=1.0"]
47+
theme_sbt = ["sphinx-book-theme~=0.3.0"]
48+
49+
[tool.flit.sdist]
50+
exclude = [
51+
"docs/",
52+
"style/",
53+
"tests/",
54+
]
55+
56+
[tool.mypy]
57+
show_error_codes = true
58+
warn_unused_ignores = true
59+
warn_redundant_casts = true
60+
no_implicit_optional = true
61+
strict_equality = true
62+
63+
[[tool.mypy.overrides]]
64+
module = ["docutils.*"]
65+
ignore_missing_imports = true
466

567
[tool.isort]
668
profile = "black"
769
src_paths = ["sphinx_design", "tests"]
70+
force_sort_within_sections = true

setup.cfg

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

setup.py

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

sphinx_design/extension.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import hashlib
2+
import importlib.resources as resources
23
from pathlib import Path
34

4-
try:
5-
import importlib.resources as resources
6-
except ImportError:
7-
# python < 3.7
8-
import importlib_resources as resources # type: ignore[no-redef]
9-
105
from docutils import nodes
116
from docutils.parsers.rst import directives
127
from sphinx.application import Sphinx

sphinx_design/icons.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1+
from functools import lru_cache
2+
import importlib.resources as resources
13
import json
24
import re
3-
from functools import lru_cache
45
from typing import Any, Dict, List, Optional, Sequence, Tuple
56

6-
try:
7-
import importlib.resources as resources
8-
except ImportError:
9-
# python < 3.7
10-
import importlib_resources as resources # type: ignore[no-redef]
11-
127
from docutils import nodes
138
from docutils.parsers.rst import directives
149
from sphinx.application import Sphinx

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from pathlib import Path
33
from typing import Any, Dict, Optional
44

5-
import pytest
65
from docutils import nodes
6+
import pytest
77
from sphinx.testing.path import path as sphinx_path
88
from sphinx.testing.util import SphinxTestApp
99

0 commit comments

Comments
 (0)