Skip to content

Commit

Permalink
Move project metadata from setup.py to pyproject.toml.
Browse files Browse the repository at this point in the history
`pyproject.toml` is the recommended way to describe projects and to declare
metadata such as its dependencies
(https://packaging.python.org/en/latest/specifications/declaring-project-metadata/).
This change also updates the PyPi version which was severely outdated (as
highlighted in issue #116).

PiperOrigin-RevId: 527587152
  • Loading branch information
kenjitoyama authored and copybara-github committed Apr 27, 2023
1 parent 6689155 commit f173385
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 28 deletions.
38 changes: 38 additions & 0 deletions android_env/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[build-system]
requires = [
"setuptools",
"wheel"
]
build-backend = "setuptools.build_meta"

[project]
name = "android-env"
version = "1.2.1"
description = "AndroidEnv environment and library for training agents."
authors = [{name = "DeepMind"}]
license = {file = "LICENSE"}
readme = {text = "Read the README at https://github.com/deepmind/android_env for more information.", content-type = "text/plain"}
keywords = ["Android", "OS", "reinforcement-learning"]
requires-python = ">=3.10"
dependencies = [
"absl-py>=0.1.0",
"dm_env",
"grpcio",
"numpy>=1.21",
"portpicker>=1.2.0",
"protobuf>=2.6",
"pygame",
]

[project.optional-dependencies]
acme = ["dm-acme"]
gym = ["gym"]
attrs = ["attrs==20.3.0"] # temporary pin to fix pytype issue.
pillow = ["pillow"]
pytype = ["pytype"]
pytest = ["pytest-xdist"]

[project.urls]
repository = "https://github.com/deepmind/android_env"
deepmind = "https://www.deepmind.com/publications/androidenv-the-android-learning-environment"
arxiv = "https://arxiv.org/abs/2105.13231"
31 changes: 3 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
from setuptools.command.build_ext import build_ext
from setuptools.command.build_py import build_py

description = """AndroidEnv
Read the README at https://github.com/deepmind/android_env for more information.
"""

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

# Tuple of proto message definitions to build Python bindings for. Paths must
Expand Down Expand Up @@ -98,32 +94,11 @@ def run(self):
build_py.run(self)

setup(
name='android_env',
version='1.1.0',
description='AndroidEnv environment and library for training agents.',
long_description=description,
author='DeepMind',
license='Apache License, Version 2.0',
keywords='Android OS reinforcement-learning',
url='https://github.com/deepmind/android_env',
packages=find_packages(exclude=['examples']),
setup_requires=[
'grpcio-tools',
],
install_requires=[
'absl-py>=0.1.0',
'dm_env',
'grpcio',
'numpy>=1.21',
'portpicker>=1.2.0',
'protobuf>=2.6',
'pygame',
],
extras_require={
'acme': ['dm-acme'],
'gym': ['gym'],
'testing': testing_requirements,
},
package_data={'': ['proto/*.proto']}, # Copy protobuf files.
include_package_data=True,
setup_requires=['grpcio-tools'],
cmdclass={
'build_ext': _BuildExt,
'build_py': _BuildPy,
Expand Down

0 comments on commit f173385

Please sign in to comment.