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

Supporting Python 3.12 #1437

Open
marcharper opened this issue Mar 8, 2024 · 1 comment
Open

Supporting Python 3.12 #1437

marcharper opened this issue Mar 8, 2024 · 1 comment

Comments

@marcharper
Copy link
Member

setuptools is deprecated and removed in Python 3.12, so we have to either use a third party version or change how we do packaging. Right now setup.py fails because setuptools is not available in the standard library. See #1428

This link is helpful: https://gregoryszorc.com/blog/2023/10/30/my-user-experience-porting-off-setup.py/

IIUC we need to migrate from setup.py to pyproject.toml. But there are some choices that need to be made, e.g. which build tool. setuptools is still an option as a third party library but there are some changes.

Some options here: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/

@marcharper
Copy link
Member Author

Here's a rough translation to pyproject.toml

[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
dynamic = ["version"]
description = "Iterated Prisoner's Dilemma in Python"
readme = {file = "README.rst", content-type = "text/x-rst"}
license = {file = "LICENSE.txt"}
authors = [
  {name = "Vince Knight"},
  {name = "Owen Campbell"},
  {name = "Karol Langner"},
  {name = "Marc Harper"},
  {email = "axelrod-python@googlegroups.com")
]
maintainers = [
  {name = "Vince Knight"},
  {name = "Owen Campbell"},
  {name = "Marc Harper"},
  {name = "Nikoleta Glynasti"}
]
requires-python = ">= 3.8"
dependencies = [
  # dask dependencies: https://docs.dask.org/en/latest/install.html
  "cloudpickle>=0.2.2",
  "fsspec>=0.6.0",
  "toolz>=0.8.2",
  "dask>=2.9.2",
  "matplotlib>=3.0.3",
  "numpy>=1.17.4",
  "pandas>=1.0.0",
  "pyyaml>=5.1",
  "scipy>=1.3.3",
  "tqdm>=4.39.0"
]
classifiers = [
  "Development Status :: 5 - Production/Stable",
  "Intended Audience :: Developers",
  "Topic :: Software Development :: Build Tools",
  "License :: OSI Approved :: MIT License",
  "Programming Language :: Python :: 3",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
]

[project.optional-dependencies]
human = ["prompt-toolkit>=3.0"]
development = [
  "prompt-toolkit>=3.0",
  "hypothesis==5.19.3",
]

[project.urls]
Documentation = "https://axelrod.readthedocs.org/"
Repository = "https://github.com/Axelrod-Python/Axelrod"

It doesn't handle these lines from setup.py yet:

    include_package_data=True,
    package_data={"": ["axelrod/data/*"]},
    packages=["axelrod", "axelrod.strategies", "axelrod.data"],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant