From 0344722a1b6c9903ce61c3daa7bf9429a1ccc293 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 22 Nov 2023 08:28:51 +0800 Subject: [PATCH 1/5] Move to a pure PEP621 project configuration. --- .travis.yml | 26 ------------------- MANIFEST.in | 18 ------------- pyproject.toml | 65 ++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 69 -------------------------------------------------- tox.ini | 22 ++++++++++------ 5 files changed, 78 insertions(+), 122 deletions(-) delete mode 100644 .travis.yml delete mode 100644 MANIFEST.in delete mode 100644 setup.cfg diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d8e9b12b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -branches: - only: - - master -os: osx -osx_image: xcode7.3 # OSX 10.11 El Capitan -language: generic -cache: - directories: - ~/.pyenv -install: - # pyenv's shims directory is not in the PATH by default. - - export PATH="$(pyenv root)/shims:${PATH}" - # Diagnostic: Find out which versions of Python are availalbe. - - pyenv install -l - # Rubicon supports Python 3.5 and newer. - # The most recent version of Python 3.5 provided by the pyenv install on - # macOS 10.11 is 3.5.2. There are more recent versions of Python 3.5 - # available, but using them would mean updating pyenv, which takes 10+ - # minutes on macOS 10.11. - - pyenv install --skip-existing 3.5.2 - - pyenv global 3.5.2 - - python -m pip install --upgrade "pip<21" - - python -m pip install --upgrade setuptools - - python -m pip install tox -script: - - python -m tox -e py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 6181eecd..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,18 +0,0 @@ -# Note: See the PyPA documentation for a list of file names that are included/excluded by default: -# https://packaging.python.org/guides/using-manifest-in/#how-files-are-included-in-an-sdist -# Please only add entries here for files that are *not* already handled by default. - -include .git-blame-ignore-revs -include .pre-commit-config.yaml -include .readthedocs.yml -include CHANGELOG.rst -include CONTRIBUTING.md -include tox.ini -recursive-include changes *.rst -include docs/Makefile -include docs/make.bat -include docs/spelling_wordlist -recursive-include docs *.png *.py *.rst -prune docs/_build -include tests/objc/Makefile -recursive-include tests *.h *.m *.py diff --git a/pyproject.toml b/pyproject.toml index 5f1d2f31..cde8cb43 100644 --- a/pyproject.toml +++ b/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", +] 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.file = "LICENSE" +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] +Project = "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 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 88cd1482..00000000 --- a/setup.cfg +++ /dev/null @@ -1,69 +0,0 @@ -[metadata] -name = rubicon-objc -url = https://beeware.org/rubicon -project_urls = - 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 -author = Russell Keith-Magee -author_email = russell@keith-magee.com -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 -license = New BSD -license_files = - LICENSE -description = A bridge between an Objective C runtime environment and Python. -long_description = file: README.rst -long_description_content_type = text/x-rst - -[options] -python_requires = >=3.8 -packages = find_namespace: -package_dir = - = src - -[options.packages.find] -where = src -include = rubicon.* - -[options.extras_require] -dev = - pre-commit == 3.5.0 - pytest == 7.4.3 - pytest-tldr == 0.2.5 - setuptools_scm[toml] == 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 - -[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, diff --git a/tox.ini b/tox.ini index bf43743f..af5ad3dd 100644 --- a/tox.ini +++ b/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} @@ -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/* From 1ca2ce142a7d80f8b8c2d7cec35696a6ddf38b6b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 22 Nov 2023 09:59:02 +0800 Subject: [PATCH 2/5] Tweaked the representation license and Homepage. --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cde8cb43..76e3ad82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ name = "rubicon-objc" description = "A bridge between an Objective C runtime environment and Python." readme = "README.rst" requires-python = ">= 3.8" -license.file = "LICENSE" +license.text = "New BSD" authors = [ {name="Russell Keith-Magee", email="russell@keith-magee.com"}, ] @@ -39,7 +39,7 @@ classifiers = [ ] [project.urls] -Project = "https://beeware.org/rubicon" +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" From 5e1a3f28c3f3556046bfdc32f5016fc69a0e4c0f Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 22 Nov 2023 10:15:00 +0800 Subject: [PATCH 3/5] Add changenote. --- changes/387.misc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/387.misc.rst diff --git a/changes/387.misc.rst b/changes/387.misc.rst new file mode 100644 index 00000000..c7137447 --- /dev/null +++ b/changes/387.misc.rst @@ -0,0 +1 @@ +The project was migrated to a PEP621-compatible configuration. From a4b2126656b814d735f2a92eae6b8c6994d8b2db Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 22 Nov 2023 10:20:02 +0800 Subject: [PATCH 4/5] Correct a test that was dependent on file on disk. --- tests/test_async.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_async.py b/tests/test_async.py index 034e386e..362457ac 100644 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -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(), ) From e475635bd5daddd7b71c5bbf1ac05aecc2d7f18f Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 22 Nov 2023 11:52:29 +0800 Subject: [PATCH 5/5] Update some http references. --- CONTRIBUTING.md | 2 +- docs/how-to/contribute-docs.rst | 2 +- docs/make.bat | 2 +- src/rubicon/objc/runtime.py | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd26d835..ec4f1c03 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/docs/how-to/contribute-docs.rst b/docs/how-to/contribute-docs.rst index 12f32b10..3afc2f32 100644 --- a/docs/how-to/contribute-docs.rst +++ b/docs/how-to/contribute-docs.rst @@ -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 `_ to +CheatSheet `_ to learn how to write your ``.rst`` file. Create a ``.rst`` file diff --git a/docs/make.bat b/docs/make.bat index e4fc26d7..079c3226 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -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 ) diff --git a/src/rubicon/objc/runtime.py b/src/rubicon/objc/runtime.py index 8c22e789..19d9e6bc 100644 --- a/src/rubicon/objc/runtime.py +++ b/src/rubicon/objc/runtime.py @@ -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 @@ -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.""" @@ -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,