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 all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -4,4 +4,4 @@ BeeWare <3's contributions!

Please be aware, BeeWare operates under a Code of Conduct.

See [CONTRIBUTING to BeeWare](http://beeware.org/contributing) for details.
See [CONTRIBUTING to BeeWare](https://beeware.org/contributing) for details.
18 changes: 0 additions & 18 deletions MANIFEST.in

This file was deleted.

1 change: 1 addition & 0 deletions changes/387.misc.rst
@@ -0,0 +1 @@
The project was migrated to a PEP621-compatible configuration.
2 changes: 1 addition & 1 deletion docs/how-to/contribute-docs.rst
Expand Up @@ -5,7 +5,7 @@ Here are some tips for working on this documentation. You're welcome to add
more and help us out!

First of all, you should check the `Restructured Text (reST) and Sphinx
CheatSheet <http://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html>`_ to
CheatSheet <https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html>`_ to
learn how to write your ``.rst`` file.

Create a ``.rst`` file
Expand Down
2 changes: 1 addition & 1 deletion docs/make.bat
Expand Up @@ -22,7 +22,7 @@ if errorlevel 9009 (
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
echo.https://sphinx-doc.org/
exit /b 1
)

Expand Down
65 changes: 64 additions & 1 deletion pyproject.toml
@@ -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="russell@keith-magee.com"},
]
maintainers = [
{name="BeeWare Team", email="team@beeware.org"},
]
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.

8 changes: 4 additions & 4 deletions src/rubicon/objc/runtime.py
Expand Up @@ -666,8 +666,8 @@ def get_class(name):
return libobjc.objc_getClass(ensure_bytes(name))


# http://www.sealiesoftware.com/blog/archive/2008/10/30/objc_explain_objc_msgSend_stret.html
# http://www.x86-64.org/documentation/abi-0.99.pdf (pp.17-23)
# https://www.sealiesoftware.com/blog/archive/2008/10/30/objc_explain_objc_msgSend_stret.html
# https://web.archive.org/web/20160810184034/http://www.x86-64.org/documentation/abi-0.99.pdf (pp.17-23)
# executive summary: on x86-64, who knows?
def should_use_stret(restype):
"""Return whether a method returning the given type must be called using
Expand All @@ -693,7 +693,7 @@ def should_use_stret(restype):
return False


# http://www.sealiesoftware.com/blog/archive/2008/11/16/objc_explain_objc_msgSend_fpret.html
# https://www.sealiesoftware.com/blog/archive/2008/11/16/objc_explain_objc_msgSend_fpret.html
def should_use_fpret(restype):
"""Return whether a method returning the given type must be called using
``objc_msgSend_fpret`` on the current system."""
Expand Down Expand Up @@ -859,7 +859,7 @@ class objc_super(Structure):
]


# http://stackoverflow.com/questions/3095360/what-exactly-is-super-in-objective-c
# https://stackoverflow.com/questions/3095360/what-exactly-is-super-in-objective-c
def send_super(
cls,
receiver,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_async.py
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
@@ -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/*