From b7b0c1affd958f94c0d9eb2c119c46494fd684b1 Mon Sep 17 00:00:00 2001 From: Jesse Farebrother Date: Tue, 28 Sep 2021 16:03:31 -0400 Subject: [PATCH] Update metadata and move CI config to pyproject.toml --- .github/workflows/build-ale-py.yml | 16 ++++++---------- .github/workflows/build-ale.yml | 4 ++-- pyproject.toml | 15 +++++++++++++-- requirements-dev.txt | 5 ----- requirements.txt | 3 --- setup.cfg | 22 ++++++++++++---------- setup.py | 1 + 7 files changed, 34 insertions(+), 32 deletions(-) delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt diff --git a/.github/workflows/build-ale-py.yml b/.github/workflows/build-ale-py.yml index e546353a4..827096b72 100644 --- a/.github/workflows/build-ale-py.yml +++ b/.github/workflows/build-ale-py.yml @@ -14,10 +14,10 @@ jobs: strategy: matrix: include: - - config: {"name": "Linux", "os": "ubuntu-latest", "deps": ["zlib", "sdl2"], "arch": "x86_64", "triplet": "x64-linux-mixed"} - - config: {"name": "Windows", "os": "windows-latest", "deps": ["zlib", "sdl2"], "arch": "AMD64", "triplet": "x64-windows"} - - config: {"name": "macOS", "os": "macos-latest", "deps": ["zlib", "sdl2"], "arch": "x86_64", "triplet": "x64-osx-mixed"} - - config: {"name": "macOS", "os": "macos-latest", "deps": ["zlib", "sdl2"], "arch": "arm64", "triplet": "arm64-osx-mixed"} + - config: {"name": "Linux", "os": "ubuntu-latest", "arch": "x86_64", "triplet": "x64-linux-mixed"} + - config: {"name": "Windows", "os": "windows-latest", "arch": "AMD64", "triplet": "x64-windows"} + - config: {"name": "macOS", "os": "macos-latest", "arch": "x86_64", "triplet": "x64-osx-mixed"} + - config: {"name": "macOS", "os": "macos-latest", "arch": "arm64", "triplet": "arm64-osx-mixed"} runs-on: ${{ matrix.config.os }} steps: - uses: actions/checkout@v2 @@ -32,16 +32,12 @@ jobs: run: echo "ALE_BUILD_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV - name: Build wheels - uses: pypa/cibuildwheel@v2.1.1 + uses: pypa/cibuildwheel@v2.1.2 env: - CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/jessefarebro/manylinux2014-vcpkg" - CIBW_SKIP: "*i686* *win32* pp* *cp310*" CIBW_ARCHS: "${{ matrix.config.arch }}" - CIBW_TEST_REQUIRES: "pytest gym" - CIBW_TEST_COMMAND: "pytest {project}" CIBW_ENVIRONMENT: "ALE_BUILD_VERSION=${{ env.ALE_BUILD_VERSION }} MACOSX_DEPLOYMENT_TARGET='10.15' VCPKG_DEFAULT_TRIPLET=${{ matrix.config.triplet }}" CIBW_BEFORE_ALL: > - vcpkg install ${{ join(matrix.config.deps, ' ') }} + vcpkg install zlib sdl2 --overlay-triplets cmake/custom-triplets --triplet ${{ matrix.config.triplet }} --feature-flags=-compilertracking diff --git a/.github/workflows/build-ale.yml b/.github/workflows/build-ale.yml index 4b6753caa..bcebc66a2 100644 --- a/.github/workflows/build-ale.yml +++ b/.github/workflows/build-ale.yml @@ -74,13 +74,13 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.pip-cache-info.outputs.dir }} - key: ${{ matrix.config.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} + key: ${{ matrix.config.os }}-pip-${{ hashFiles('**/setup.cfg') }} restore-keys: | ${{ matrix.config.os }}-pip- - name: Install pip dependencies run: | - python -m pip install -r requirements-dev.txt + python -m pip install .[test] - name: Configure ALE run: | diff --git a/pyproject.toml b/pyproject.toml index 71a3741b2..3a5499e09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,19 @@ [build-system] requires = [ - "setuptools>=42", + "setuptools>=58", "wheel", - "cmake>=3.14", + "cmake>=3.18", "ninja; sys_platform != 'win32' and platform_machine != 'arm64'", ] build-backend = "setuptools.build_meta" + + +[tool.cibuildwheel] +skip = "*-win32 *-manylinux_i686 pp* cp310-*" + +build-frontend = "build" + +test-extras = ["test"] +test-command = "pytest {project}" + +manylinux-x86_64-image = "ghcr.io/jessefarebro/manylinux2014-vcpkg" \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 2970f65ec..000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,5 +0,0 @@ -numpy -gym -importlib-metadata; python_version < '3.8' -importlib-resources -pytest diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 8fd273e60..000000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -numpy -importlib-metadata; python_version < '3.8' -importlib-resources diff --git a/setup.cfg b/setup.cfg index a3d266cc9..5fd8554dd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,14 +1,13 @@ [metadata] -license = GPLv2 -license_file = LICENSE.md name = ale-py -author = Arcade Learning Environment Authors +author = The Arcade Learning Environment Authors maintainer = Jesse Farebrother -maintainer_email = jfarebro@cs.ualberta.ca +maintainer_email = jfarebro@cs.mcgill.ca +license = GPLv2 +license_file = LICENSE.md description = The Arcade Learning Environment (ALE) - a platform for AI research. -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/mgbellemare/Arcade-Learning-Environment +long_description = file: README.md CHANGELOG.md LICENSE.md +home-page = https://github.com/mgbellemare/Arcade-Learning-Environment classifiers = Development Status :: 5 - Production/Stable Intended Audience :: Science/Research @@ -19,9 +18,10 @@ classifiers = Topic :: Scientific/Engineering :: Artificial Intelligence keywords = reinforcement-learning arcade-learning-environment atari project_urls = - Documentation = https://arcadelearningenvironment.org + Documentation = https://github.com/mgbellemare/Arcade-Learning-Environment/tree/master/docs Source = https://github.com/mgbellemare/Arcade-Learning-Environment Tracker = https://github.com/mgbellemare/Arcade-Learning-Environment/issues + Changelog = https://github.com/mgbellemare/Arcade-Learning-Environment/blob/master/CHANGELOG.md [options] python_requires = >=3.6 @@ -38,9 +38,11 @@ install_requires = numpy importlib-metadata; python_version < '3.8' importlib-resources -tests_require = - gym + +[options.extras_require] +test = pytest + gym [options.entry_points] console_scripts = diff --git a/setup.py b/setup.py index 7aabbd3ee..27973836f 100644 --- a/setup.py +++ b/setup.py @@ -151,6 +151,7 @@ def parse_version(version_file): # Most config options are in `setup.cfg`. These are the # only dynamic options we need at build time. setup( + name="ale-py", version=parse_version('version.txt'), distclass=CMakeDistribution, ext_modules=[CMakeExtension("ale_py._ale_py")],