From 997c63be7d7bf331980219e85f06d5598ec3d49a Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Thu, 9 Jan 2025 20:53:32 +0100 Subject: [PATCH] Release v0.3.1 --- CHANGELOG.md | 8 +- CONTRIBUTING.md | 6 +- COPYING | 2 +- MANIFEST.in | 9 -- pyproject.toml | 2 +- setup.cfg | 91 ---------------- setup.py | 127 ---------------------- sphinxcontrib/svgbob/__init__.py | 2 +- sphinxcontrib/svgbob/_svgbob/Cargo.lock | 2 +- sphinxcontrib/svgbob/_svgbob/Cargo.toml | 2 +- sphinxcontrib/svgbob/tests/test_sphinx.py | 2 + 11 files changed, 17 insertions(+), 236 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/CHANGELOG.md b/CHANGELOG.md index d59f421..251ed28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -[Unreleased]: https://github.com/althonos/sphinxcontrib-svgbob/compare/v0.3.0...HEAD +[Unreleased]: https://github.com/althonos/sphinxcontrib-svgbob/compare/v0.3.1...HEAD + + +## [v0.3.1] - 2025-01-09 +[v0.3.1]: https://github.com/althonos/sphinxcontrib-svgbob/compare/v0.3.0...v0.3.1 ### Changed +- Use `maturin` instead of `setuptools-rust` to handle the build process. - Bumped `built` dependency from `0.5.1` to `0.7.5`. - Bumped `pyo3` dependency from `0.17.1` to `0.23.3`. + ## [v0.3.0] - 2024-08-14 [v0.3.0]: https://github.com/althonos/sphinxcontrib-svgbob/compare/v0.2.1...v0.3.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a45ae0..0d9cc59 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,13 +20,13 @@ the standard library. Running them requires the extension to be built locally: ```console -$ python setup.py build_ext --inplace -$ python -m unittest discover -vv +$ python -m pip install --no-build-isolation -e . -v +$ python -m unittest sphinxcontrib.svgbob.tests -vv ``` ## Coding guidelines -This project targets Python 3.6 or later. +This project targets Python 3.7 or later. ### Type hints diff --git a/COPYING b/COPYING index f342bfd..2ad54e6 100644 --- a/COPYING +++ b/COPYING @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Martin Larralde +Copyright (c) 2021-2025 Martin Larralde Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index ba10b67..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,9 +0,0 @@ -include README.md -include CHANGELOG.md -include CONTRIBUTING.md -include COPYING -include pyproject.toml -recursive-include sphinxcontrib/svgbob *.pyi py.typed -recursive-include sphinxcontrib/svgbob/_svgbob *.rs Cargo.toml Cargo.lock -prune sphinxcontrib/svgbob/_svgbob/target -prune tests diff --git a/pyproject.toml b/pyproject.toml index 4b6db47..99e100d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ features = ["extension-module"] module-name = "sphinxcontrib.svgbob._svgbob" [tool.cibuildwheel] -skip = ["*-musllinux_i686"] +skip = ["*-musllinux_i686", "pp*"] test-command = "python -m unittest sphinxcontrib.svgbob.tests -v" before-build = "pip install maturin" build-verbosity = 1 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e0464f4..0000000 --- a/setup.cfg +++ /dev/null @@ -1,91 +0,0 @@ -[metadata] -name = sphinxcontrib-svgbob -version = attr: sphinxcontrib.svgbob.__version__ -author = Martin Larralde -author_email = martin.larralde@embl.de -home_page = https://github.com/sphinx-contrib/svgbob -description = A Sphinx extension to convert ASCII diagrams to SVGs with Svgbob. -long_description = file: README.md -long_description_content_type = text/markdown -license = MIT -license_file = COPYING -platform = any -keywords = sphinx, documentation, svg, diagram, ascii -classifiers = - Development Status :: 4 - Beta - Framework :: Sphinx :: Extension - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: 3.13 - Programming Language :: Rust - Topic :: Documentation :: Sphinx - Topic :: Software Development :: Documentation - Topic :: Text Processing - Typing :: Typed -project_urls = - Bug Tracker = https://github.com/sphinx-contrib/svgbob/issues - Changelog = https://github.com/sphinx-contrib/svgbob/blob/master/CHANGELOG.md - -[options] -zip_safe = false -include_package_data = true -python_requires = >=3.6 -packages = sphinxcontrib.svgbob -test_suite = tests -setup_requires = - setuptools >=46.4 - setuptools-rust >=0.12 - wheel -install_requires = - sphinx - -[options.package_data] -sphinxcontrib.svgbob = py.typed - -[sdist] -formats = gztar - -[coverage:run] -source = sphinxcontrib - -[coverage:report] -show_missing = true -exclude_lines = - pragma: no cover - if False - -[green] -file-pattern = test_*.py -verbose = 2 -no-skip-report = true -quiet-stdout = true -run-coverage = true - -[pydocstyle] -match-dir = (?!tests)(?!resources)(?!docs)[^\.].* -match = (?!test)(?!setup)[^\._].*\.py -inherit = false -ignore = D200, D203, D213, D406, D407 # Google conventions - -[flake8] -max-line-length = 99 -doctests = True -exclude = .git, .eggs, __pycache__, tests/, docs/, build/, dist/ - -[mypy] -disallow_any_decorated = true -disallow_any_generics = true -disallow_any_unimported = false -disallow_subclassing_any = false -disallow_untyped_calls = true -disallow_untyped_defs = true -ignore_missing_imports = true -warn_unused_ignores = true -warn_return_any = true diff --git a/setup.py b/setup.py deleted file mode 100644 index 8c9be62..0000000 --- a/setup.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python3 - -import configparser -import os -import shutil -import subprocess -import sys -import urllib.request - -import setuptools -import setuptools_rust -from distutils.errors import DistutilsPlatformError -from distutils.log import INFO -from setuptools.command.sdist import sdist as _sdist -from setuptools_rust.build import build_rust as _build_rust - -try: - from setuptools_rust.rustc_info import get_rust_version -except ImportError: - from setuptools_rust.utils import get_rust_version - - -class vendor(setuptools.Command): - - description = "vendor Rust dependencies into a local folder" - user_options = [ - ("vendor-dir=", "d", "the path where to vendor the Rust crates") - ] - - def initialize_options(self): - self.vendor_dir = None - - def finalize_options(self): - if self.vendor_dir is None: - self.vendor_dir = "crates" - - def run(self): - # make sure rust is available - _build_cmd = self.get_finalized_command("build_rust") - rustc = get_rust_version() - if rustc is None: - _build_cmd.setup_temp_rustc_unix(toolchain="stable", profile="minimal") - # vendor crates - path = next(ext.path for ext in self.distribution.rust_extensions) - proc = subprocess.run(["cargo", "vendor", self.vendor_dir, "--manifest-path", path]) - proc.check_returncode() - # write the cargo config file - self.mkpath(".cargo") - with open(os.path.join(".cargo", "config.toml"), "w") as f: - f.write( - """ - [source.crates-io] - replace-with = "vendored-sources" - - [source.vendored-sources] - directory = "{}" - """.format(self.vendor_dir) - ) - - -class build_rust(_build_rust): - - def run(self): - try: - rustc = get_rust_version() - except DistutilsPlatformError: - rustc = None - if rustc is not None: - nightly = rustc.prerelease is not None and "nightly" in rustc.prerelease - else: - if sys.platform in ("linux", "darwin"): - self.setup_temp_rustc_unix(toolchain="nightly", profile="minimal") - nightly = True - else: - nightly = False - - if self.inplace: - self.extensions[0].strip = setuptools_rust.Strip.No - if nightly: - self.extensions[0].features = (*self.extensions[0].features, "nightly") - - _build_rust.run(self) - - - def setup_temp_rustc_unix(self, toolchain, profile): - rustup_sh = os.path.join(self.build_temp, "rustup.sh") - os.environ["CARGO_HOME"] = os.path.join(self.build_temp, "cargo") - os.environ["RUSTUP_HOME"] = os.path.join(self.build_temp, "rustup") - - self.mkpath(os.environ["CARGO_HOME"]) - self.mkpath(os.environ["RUSTUP_HOME"]) - - self.announce("downloading rustup.sh install script", level=INFO) - with urllib.request.urlopen("https://sh.rustup.rs") as res: - with open(rustup_sh, "wb") as dst: - shutil.copyfileobj(res, dst) - - self.announce("installing Rust compiler to {}".format(self.build_temp), level=INFO) - subprocess.call([ - "/bin/sh", - rustup_sh, - "-y", - "--default-toolchain", - toolchain, - "--profile", - profile, - "--no-modify-path" - ]) - - self.announce("updating $PATH variable to use local Rust compiler", level=INFO) - os.environ["PATH"] = ":".join([ - os.path.abspath(os.path.join(os.environ["CARGO_HOME"], "bin")), - os.environ["PATH"] - ]) - - -setuptools.setup( - cmdclass=dict(build_rust=build_rust, vendor=vendor), - rust_extensions=[ - setuptools_rust.RustExtension( - "sphinxcontrib.svgbob._svgbob", - path=os.path.join("sphinxcontrib", "svgbob", "_svgbob", "Cargo.toml"), - binding=setuptools_rust.Binding.PyO3, - strip=setuptools_rust.Strip.Debug, - ) - ], -) diff --git a/sphinxcontrib/svgbob/__init__.py b/sphinxcontrib/svgbob/__init__.py index 0ff5a19..f072630 100644 --- a/sphinxcontrib/svgbob/__init__.py +++ b/sphinxcontrib/svgbob/__init__.py @@ -6,7 +6,7 @@ from .transform import SvgbobToImageTransform -__version__ = "0.3.0" +__version__ = "0.3.1" def setup(app: Sphinx) -> typing.Dict[str, typing.Any]: diff --git a/sphinxcontrib/svgbob/_svgbob/Cargo.lock b/sphinxcontrib/svgbob/_svgbob/Cargo.lock index 748dbc1..3e5e0d1 100644 --- a/sphinxcontrib/svgbob/_svgbob/Cargo.lock +++ b/sphinxcontrib/svgbob/_svgbob/Cargo.lock @@ -1095,7 +1095,7 @@ dependencies = [ [[package]] name = "sphinxcontrib-svgbob" -version = "0.3.0" +version = "0.3.1" dependencies = [ "built", "pyo3", diff --git a/sphinxcontrib/svgbob/_svgbob/Cargo.toml b/sphinxcontrib/svgbob/_svgbob/Cargo.toml index eb56cf1..2773f48 100644 --- a/sphinxcontrib/svgbob/_svgbob/Cargo.toml +++ b/sphinxcontrib/svgbob/_svgbob/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sphinxcontrib-svgbob" -version = "0.3.0" +version = "0.3.1" authors = ["Martin Larralde "] edition = "2021" license = "MIT" diff --git a/sphinxcontrib/svgbob/tests/test_sphinx.py b/sphinxcontrib/svgbob/tests/test_sphinx.py index 2351aaf..837881e 100644 --- a/sphinxcontrib/svgbob/tests/test_sphinx.py +++ b/sphinxcontrib/svgbob/tests/test_sphinx.py @@ -1,5 +1,6 @@ import os import shutil +import sys import tempfile import textwrap import unittest @@ -33,6 +34,7 @@ def setUpClass(cls): def tearDownClass(cls): shutil.rmtree(cls.docs_folder) + @unittest.skipIf(sys.version_info[:2] == (3, 7), "sphinx.builders.linkcheck may not be supported") def build(self, builder="html"): retcode = sphinx.cmd.build.main([ "-q",