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 to a pure PEP621 project configuration. #387

Merged
merged 5 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

18 changes: 0 additions & 18 deletions MANIFEST.in

This file was deleted.

1 change: 1 addition & 0 deletions changes/387.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The project was migrated to a PEP621-compatible configuration.
65 changes: 64 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,70 @@
[build-system]
requires = ["setuptools>=60", "setuptools_scm[toml]>=7.0"]
requires = [
"setuptools==69.0.0",
"setuptools_scm==8.0.4",
Comment on lines +3 to +4
Copy link
Collaborator

@dgelessus dgelessus Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the pins here instead of minimum versions like before? Surely we support more than just these exact versions.

(The setuptools pyproject.toml docs say that at least setuptools 61.0.0 is required for pyproject.toml support.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reproducibility. For example, the dynamic argument in pyproject.toml wasn't required on setuptools 68.0, but it is required on 69.0. If you use an open ended pin, a project configuration that works on the day of release can break in the future.

With a hard pin, we know the configuration works with this specific set of versions, and that won't change. Those versions might not be compatible with future versions of pip, Python etc - but then, we can't make any guarantees about what might happen in future regardless.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify further: build-requires specify the environment that will be created specifically for the purpose of wheel creation. It's guaranteed to be an isolated environment (unless you specifically disable isolation, in which case you're on your own), so we don't need to maintain maximum compatibility with the end-user's environment. You're specifying the exact environment that you want to be present to build the wheel; an open ended pin undermines that, because we can't guarantee that the build environment will match a configuration that we know works.

]
build-backend = "setuptools.build_meta"

[project]
dynamic = ["version"]
name = "rubicon-objc"
description = "A bridge between an Objective C runtime environment and Python."
readme = "README.rst"
requires-python = ">= 3.8"
license.text = "New BSD"
authors = [
{name="Russell Keith-Magee", email="[email protected]"},
]
maintainers = [
{name="BeeWare Team", email="[email protected]"},
]
keywords = [
"macOS",
"iOS",
"Objective C",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Objective C",
"Programming Language :: Python :: 3",
"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 :: Only",
"Topic :: Software Development",
]

[project.urls]
Homepage = "https://beeware.org/rubicon"
Funding = "https://beeware.org/contributing/membership/"
Documentation = "https://rubicon-objc.readthedocs.io/en/latest/"
Tracker = "https://github.com/beeware/rubicon-objc/issues"
Source = "https://github.com/beeware/rubicon-objc"

[project.optional-dependencies]
dev = [
"pre-commit == 3.5.0",
"pytest == 7.4.3",
"pytest-tldr == 0.2.5",
"setuptools_scm == 8.0.4",
"tox == 4.11.3",
]
docs = [
"furo == 2023.9.10",
"pyenchant == 3.2.2",
# Sphinx 7.2 deprecated support for Python 3.8
"sphinx == 7.1.2 ; python_version < '3.9'",
"sphinx == 7.2.6 ; python_version >= '3.9'",
"sphinx_tabs == 3.4.4",
"sphinx-autobuild == 2021.3.14",
"sphinx-copybutton == 0.5.2",
"sphinxcontrib-spelling == 8.0.0",
]

[tool.codespell]
skip = ".git,*.pdf,*.svg"
# the way to make case sensitive skips of words etc
Expand Down
69 changes: 0 additions & 69 deletions setup.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ async def list_dir():
# Everything in the sample set, less everything from the result,
# should be an empty set.
self.assertEqual(
{"README.rst", "MANIFEST.in", "setup.cfg"} - task.result(),
{"README.rst"} - task.result(),
set(),
)
22 changes: 14 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
# flake8 doesn't believe in pyproject.toml, so we keep the configuration here.
[flake8]
# https://flake8.readthedocs.org/en/latest/
exclude=\
venv*/*,\
local/*,\
.tox/*
max-line-length = 119
extend-ignore =
# whitespace before :
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,

[tox]
envlist = towncrier-check,docs{,-lint,-all},py{38,39,310,311,312}
Expand Down Expand Up @@ -63,10 +71,8 @@ commands =
package_env = none
skip_install = True
deps =
check_manifest
build
twine
build==1.0.3
twine==4.0.2
commands =
check-manifest -v
python -m build --outdir dist/ .
python -m twine check dist/*