Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move project metadata to pyproject.toml, clean-up #883

Merged
merged 9 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions setup.cfg → .flake8
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[metadata]
license_file = LICENSE

[flake8]
max-line-length = 100
mwtoews marked this conversation as resolved.
Show resolved Hide resolved
exclude = compoundsuper.py,indexsuper.py
extend-ignore = E203, E231
per-file-ignores =
breathe/parser/index.py:E305

[bdist_wheel]
universal = 0
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

Expand All @@ -19,9 +19,9 @@ jobs:

- name: install dependencies
run: |
pip install -r requirements/development.txt
sudo apt-get -y update
sudo apt-get -y install graphviz libclang1-11 libclang-cpp11
pip install -e .[dev]

- name: install doxygen from SF binary archives
env:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: set up python
uses: actions/setup-python@v1

- name: install dependencies
run: |
pip install -r requirements/development.txt
pip install -e .[lint]

- name: lint the source code
run: make flake8
Expand All @@ -28,6 +28,3 @@ jobs:

- name: type check the source code
run: make type-check

- name: check version numbers are in sync
run: make version-check
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
mwtoews marked this conversation as resolved.
Show resolved Hide resolved
restore-keys: |
${{ runner.os }}-pip-
- name: set up python ${{ matrix.python-version }}
Expand All @@ -58,7 +58,7 @@ jobs:

- name: install dependencies
run: |
pip install -r requirements/development.txt
pip install -e .[dev]

- name: run the unit tests
run: make dev-test
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,3 @@ black:
.PHONY: type-check
type-check:
mypy --warn-redundant-casts --warn-unused-ignores breathe tests

.PHONY: version-check
version-check:
PYTHONPATH=../:$(PYTHONPATH) python3 scripts/version-check.py
1 change: 0 additions & 1 deletion breathe-apidoc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

Expand Down
2 changes: 1 addition & 1 deletion breathe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from sphinx.application import Sphinx

# Keep in sync with setup.py __version__
# Keep version here
__version__ = "4.34.0"


Expand Down
1 change: 0 additions & 1 deletion breathe/apidoc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
breathe.apidoc
~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion documentation/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ dependencies:
- doxygen
- pip
- pip:
- -r ../requirements/development.txt
- ..[dev]
8 changes: 3 additions & 5 deletions documentation/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
#
# BreatheExample documentation build configuration file, created by
# sphinx-quickstart on Tue Feb 3 18:20:48 2009.
#
Expand Down Expand Up @@ -123,9 +121,9 @@
release = "compare"

# Only add spelling extension if it is available. We don't know if it is installed as we don't want
# to put it in the setup.py file as a dependency as we don't want Breathe to be dependent on it as
# people should be able to use Breathe without 'spelling'. There might be a better way to handle
# this.
# to put it in the pyproject.toml file as a dependency as we don't want Breathe to be dependent on
# it as people should be able to use Breathe without 'spelling'. There might be a better way to
# handle this.
try:
import sphinxcontrib.spelling

Expand Down
3 changes: 2 additions & 1 deletion mkrelease
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pack()
tar -xf "breathe-$version.tar.gz"

cd -- "breathe-$version"
python3 setup.py sdist bdist_wheel
python3 -m build
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved
mv -- dist ..

cd -- ..
Expand All @@ -66,6 +66,7 @@ upload()
(
cd -- mkrelease_tmp

twine check --strict dist/*
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved
twine upload -- dist/*

{
Expand Down
73 changes: 73 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

[project]
name = "breathe"
dynamic = ["version"]
authors = [
{name = "Michael Jones", email = "m.pricejones@gmail.com"},
]
description = "Sphinx Doxygen renderer"
license = {text = "BSD-3-Clause"}
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Environment :: Web Environment",
"Framework :: Sphinx :: Extension",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Documentation",
"Topic :: Text Processing",
"Topic :: Utilities",
]
requires-python = ">=3.7"
dependencies = [
"docutils>=0.12",
"Jinja2>=2.7.3",
"MarkupSafe>=0.23",
"Pygments>=1.6",
"Sphinx>=4.0,!=5.0.0",
]

[project.optional-dependencies]
lint = [
"black==22.3.0",
"flake8",
"mypy>=0.900",
]
test = [
"pytest",
]
dev = [
"breathe[lint,test]",
"furo",
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved
"pip-tools>=0.3.5",
"types-docutils>=0.14,<0.18",
"types-Pygments",
"sphinx-copybutton",
]

[project.scripts]
breathe-apidoc = "breathe.apidoc:main"

[project.readme]
text = """\
Breathe is an extension to reStructuredText and Sphinx to be able to read and
render `Doxygen <https://www.doxygen.nl>`__ xml output.
"""
content-type = "text/x-rst"

[project.urls]
Home = "https://www.breathe-doc.org/"
Repository = "https://github.com/breathe-doc/breathe"

[tool.setuptools.dynamic]
version = {attr = "breathe.__init__.__version__"}
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved

[tool.setuptools.packages.find]
include = ["breathe", "breathe.*"]

[tool.black]
line-length = 100
extend-exclude = '''
Expand Down
14 changes: 0 additions & 14 deletions requirements/development.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements/production.txt

This file was deleted.

28 changes: 0 additions & 28 deletions scripts/version-check.py

This file was deleted.

63 changes: 2 additions & 61 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,61 +1,2 @@
# -*- coding: utf-8 -*-
try:
from setuptools import setup, find_packages
except ImportError:
import distribute_setup

distribute_setup.use_setuptools()
from setuptools import setup, find_packages

import sys

# Keep in sync with breathe/__init__.py __version__
__version__ = "4.34.0"

long_desc = """
Breathe is an extension to reStructuredText and Sphinx to be able to read and
render `Doxygen <http://www.doxygen.org>`__ xml output.
"""

requires = ["Sphinx>=4.0,!=5.0.0", "docutils>=0.12"]

if sys.version_info < (3, 7):
print("ERROR: Sphinx requires at least Python 3.7 to run.")
sys.exit(1)


setup(
name="breathe",
version=__version__,
url="https://github.com/michaeljones/breathe",
download_url="https://github.com/michaeljones/breathe",
license="BSD",
author="Michael Jones",
author_email="m.pricejones@gmail.com",
description="Sphinx Doxygen renderer",
long_description=long_desc,
zip_safe=False,
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"Environment :: Web Environment",
"Framework :: Sphinx :: Extension",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Documentation",
"Topic :: Text Processing",
"Topic :: Utilities",
],
platforms="any",
packages=find_packages(),
include_package_data=True,
entry_points={
"console_scripts": [
"breathe-apidoc = breathe.apidoc:main",
],
},
install_requires=requires,
)
from setuptools import setup
mwtoews marked this conversation as resolved.
Show resolved Hide resolved
setup(name="breathe")
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 0 additions & 2 deletions tests/warnings/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
#
# Test Breathe Warnings documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 5 18:57:21 2014.
#
Expand Down