Skip to content

Commit b9645d5

Browse files
committed
Use declarative metadata
- Move to pyproject.toml metadata - Use pypa/build - Update workflows and tooling
1 parent 63d72b5 commit b9645d5

File tree

5 files changed

+78
-54
lines changed

5 files changed

+78
-54
lines changed

.github/workflows/workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
set -xe
4848
python -VV
4949
python -m site
50-
python -m pip install --upgrade pip setuptools wheel
50+
python -m pip install --upgrade pip
5151
python -m pip install -r dev-requirements.txt
5252
- name: Install package
5353
run: |
@@ -92,7 +92,7 @@ jobs:
9292
run: |
9393
python -VV
9494
python -m site
95-
python -m pip install --upgrade pip setuptools wheel
95+
python -m pip install --upgrade pip
9696
python -m pip install -r dev-requirements.txt
9797
python -m pip install "sphinx${{ matrix.sphinx-version }}"
9898
- name: Download sdist and wheel artifacts

LICENSE.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without
55
modification, are permitted provided that the following conditions are met:
6-
* Redistributions of source code must retain the above copyright
7-
notice, this list of conditions and the following disclaimer.
8-
* Redistributions in binary form must reproduce the above copyright
9-
notice, this list of conditions and the following disclaimer in the
10-
documentation and/or other materials provided with the distribution.
11-
* Neither the name of the FIRST nor the
12-
names of its contributors may be used to endorse or promote products
13-
derived from this software without specific prior written permission.
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above copyright
10+
notice, this list of conditions and the following disclaimer in the
11+
documentation and/or other materials provided with the distribution.
12+
* Neither the name of the FIRST nor the
13+
names of its contributors may be used to endorse or promote products
14+
derived from this software without specific prior written permission.
1415

1516
THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS "AS IS" AND ANY
1617
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -21,4 +22,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2122
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2223
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2324
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

dev-requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
sphinx
2-
wheel==0.43.0
2+
build>=1
33
pytest==7.4.4
44
beautifulsoup4==4.12.3
5-
setuptools==70.1.0

pyproject.toml

Lines changed: 63 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,65 @@
1-
import setuptools
1+
[build-system]
2+
requires = ["flit_core>=3.7"]
3+
build-backend = "flit_core.buildapi"
24

3-
with open("README.md", encoding="utf-8") as readme:
4-
long_description = readme.read()
5+
# project metadata
6+
[project]
7+
name = "sphinxext-opengraph"
8+
description = "Sphinx Extension to enable OGP support"
9+
readme = "README.md"
10+
urls.Code = "https://github.com/wpilibsuite/sphinxext-opengraph/"
11+
urls.Documentation = "https://sphinxext-opengraph.readthedocs.io/"
12+
urls.Download = "https://pypi.org/project/sphinxext-opengraph/"
13+
urls.Homepage = "https://github.com/wpilibsuite/sphinxext-opengraph/"
14+
urls."Issue tracker" = "https://github.com/wpilibsuite/sphinxext-opengraph/issues"
15+
license.text = "BSD-3-Clause"
16+
requires-python = ">=3.8"
517

6-
setuptools.setup(
7-
name="sphinxext-opengraph",
8-
use_scm_version=True,
9-
setup_requires=["setuptools_scm"],
10-
author="Itay Ziv",
11-
author_email="[email protected]",
12-
description="Sphinx Extension to enable OGP support",
13-
long_description=long_description,
14-
long_description_content_type="text/markdown",
15-
url="https://github.com/wpilibsuite/sphinxext-opengraph",
16-
license="LICENSE.md",
17-
install_requires=["sphinx>=5.0"],
18-
packages=["sphinxext/opengraph"],
19-
include_package_data=True,
20-
package_data={"sphinxext.opengraph": ["sphinxext/opengraph/_static/*"]},
21-
classifiers=[
22-
"Development Status :: 5 - Production/Stable",
23-
"Environment :: Plugins",
24-
"Environment :: Web Environment",
25-
"Framework :: Sphinx :: Extension",
26-
"Intended Audience :: Developers",
27-
"License :: OSI Approved :: BSD License",
28-
"Natural Language :: English",
29-
"Operating System :: OS Independent",
30-
"Programming Language :: Python :: 3.8",
31-
"Programming Language :: Python :: 3.9",
32-
"Programming Language :: Python :: 3.10",
33-
"Programming Language :: Python :: 3.11",
34-
"Programming Language :: Python :: 3.12",
35-
"Programming Language :: Python",
36-
"Topic :: Documentation :: Sphinx",
37-
"Topic :: Documentation",
38-
"Topic :: Software Development :: Documentation",
39-
"Topic :: Text Processing",
40-
"Topic :: Utilities",
41-
],
42-
python_requires=">=3.8",
43-
)
18+
# Classifiers list: https://pypi.org/classifiers/
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Environment :: Plugins",
22+
"Environment :: Web Environment",
23+
"Framework :: Sphinx :: Extension",
24+
"Intended Audience :: Developers",
25+
"License :: OSI Approved :: BSD License",
26+
"Natural Language :: English",
27+
"Operating System :: OS Independent",
28+
"Programming Language :: Python :: 3.8",
29+
"Programming Language :: Python :: 3.9",
30+
"Programming Language :: Python :: 3.10",
31+
"Programming Language :: Python :: 3.11",
32+
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python",
34+
"Topic :: Documentation :: Sphinx",
35+
"Topic :: Documentation",
36+
"Topic :: Software Development :: Documentation",
37+
"Topic :: Text Processing",
38+
"Topic :: Utilities",
39+
]
40+
dependencies = [
41+
"Sphinx>=5.0",
42+
]
43+
dynamic = ["version"]
44+
45+
[[project.authors]]
46+
name = "Itay Ziv"
47+
48+
49+
[tool.flit.module]
50+
name = "sphinxext.opengraph"
51+
52+
[tool.flit.sdist]
53+
include = [
54+
"LICENSE.md",
55+
# Documentation
56+
"docs/",
57+
# Resources
58+
"sphinxext/opengraph/_static/",
59+
# Tests
60+
"tests/",
61+
"noxfile.py",
62+
]
63+
exclude = [
64+
"doc/_build",
65+
]

sphinxext/opengraph/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import os
2222

23+
__version__ = "0.9.1"
24+
version_info = (0, 9, 1)
2325

2426
DEFAULT_DESCRIPTION_LENGTH = 200
2527
DEFAULT_DESCRIPTION_LENGTH_SOCIAL_CARDS = 160

0 commit comments

Comments
 (0)