Skip to content

Commit

Permalink
Move setup.cfg -> pyproject.toml & remove Distribution to fix setupto…
Browse files Browse the repository at this point in the history
…ols upgrade
  • Loading branch information
JesseFarebro committed Apr 15, 2022
1 parent e2923c8 commit 80de842
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 74 deletions.
61 changes: 60 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,71 @@
[build-system]
requires = [
"setuptools>=58",
"setuptools>=61",
"wheel",
"cmake~=3.20.5",
"ninja; sys_platform != 'win32' and platform_machine != 'arm64'",
]
build-backend = "setuptools.build_meta"

[project]
name = "ale-py"
description = "The Arcade Learning Environment (ALE) - a platform for AI research."
readme = "README.md"
requires-python = ">=3.7"
license = {file = "LICENSE.md"}
keywords = ["reinforcement-learning", "arcade-learning-environment", "atari"]
authors = [
{name = "Marc G. Bellemare"},
{name = "Yavar Naddaf"},
{name = "Joel Veness"},
{name = "Michael Bowling"},
]
maintainers = [
{name = "Jesse Farebrother", email = "[email protected]"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
"numpy",
"importlib-metadata>=4.10.0; python_version < '3.10'",
"importlib-resources",
]
dynamic = ["version"]

[project.optional-dependencies]
test = [
"pytest",
"gym",
]

[project.urls]
homepage = "https://github.com/mgbellemare/Arcade-Learning-Environment"
documentation = "https://github.com/mgbellemare/Arcade-Learning-Environment/tree/master/docs"
changelog = "https://github.com/mgbellemare/Arcade-Learning-Environment/blob/master/CHANGELOG.md"

[project.scripts]
ale-import-roms = "ale_py.scripts.import_roms:main"

[project.entry-points."gym.envs"]
ALE = "ale_py.gym:register_gym_envs"
__internal__ = "ale_py.gym:register_legacy_gym_envs"

[tool.setuptools]
packages = [
"ale_py",
"ale_py.roms",
"ale_py.scripts",
"gym.envs.atari"
]
package-dir = {ale_py = "src/python", gym = "src/gym"}
package-data = {"ale_py.roms" = ["*.bin"]}

[tool.cibuildwheel]
# Skip 32-bit wheels, PyPy & musllinux
Expand Down
55 changes: 0 additions & 55 deletions setup.cfg

This file was deleted.

18 changes: 1 addition & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
import os
import re
import sys
import shlex
import subprocess

from setuptools import setup, Extension, Distribution
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext

here = os.path.abspath(os.path.dirname(__file__))


class CMakeDistribution(Distribution):
global_options = Distribution.global_options
global_options += [
("cmake-options=", None, "Additional semicolon-separated cmake options.")
]

def __init__(self, attrs=None):
self.cmake_options = None
super().__init__(attrs)


class CMakeExtension(Extension):
def __init__(self, name, sourcedir=""):
Extension.__init__(self, name, sources=[])
Expand Down Expand Up @@ -99,9 +87,6 @@ def build_extension(self, ext):
if archs:
cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))]

if self.distribution.cmake_options is not None:
cmake_args += shlex.split(self.distribution.cmake_options)

# Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level
# across all generators.
if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ:
Expand Down Expand Up @@ -173,7 +158,6 @@ def parse_version(version_file):
setup(
name="ale-py",
version=parse_version("version.txt"),
distclass=CMakeDistribution,
ext_modules=[CMakeExtension("ale_py._ale_py")],
cmdclass={"build_ext": CMakeBuild},
)
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
},
"builtin-baseline": "9349a6a56c7dec7e8b8846f80d83e335aad86c7e",
"overrides": [
{ "name": "sdl2", "version": "2.0.14" }
{ "name": "sdl2", "version": "2.0.20" }
]
}

0 comments on commit 80de842

Please sign in to comment.