Skip to content

Commit

Permalink
Add pyproject.toml (#416)
Browse files Browse the repository at this point in the history
* Test only pyproject.toml changes

* Add print lines and remove setup.cfg as it resulted in errors in CI

* Change setup to not install deps, hardcoded version number to test
  • Loading branch information
elliottower authored Jun 29, 2023
1 parent b2a4cbb commit cb871e5
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 31 deletions.
11 changes: 9 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,20 @@ ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$HOME/.mujoco/mujoco210/bin

RUN python3 -m venv $HOME/venv

# Copy setup.py first, so that the Docker cache doesn't expire until
# Copy setup.py/config.cfg/pyproject.toml first, so that the Docker cache doesn't expire until
# dependencies change
COPY --chown=$USER:$USER setup.py $HOME/code/metaworld/setup.py
COPY --chown=$USER:$USER pyproject.toml $HOME/code/metaworld/pyproject.toml

WORKDIR $HOME/code/metaworld

# Testing: list out all files
RUN ls -alh
RUN pwd
RUN ls ..

# Install metaworld dependencies
RUN . $HOME/venv/bin/activate && exec pip install -e .[dev]
RUN . $HOME/venv/bin/activate && exec pip install -e .[testing]

# Add code stub last
COPY --chown=$USER:$USER . $HOME/code/metaworld
Expand Down
88 changes: 88 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Package ######################################################################

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

[project]
name = "metaworld"
description = "Collections of robotics environments geared towards benchmarking multi-task and meta reinforcement learning."
readme = "README.md"
requires-python = ">= 3.8"
authors = [{ name = "Farama Foundation", email = "contact@farama.org" }]
license = { text = "MIT License" }
keywords = ["Reinforcement Learning", "game", "RL", "AI", "gymnasium"]
classifiers = [
"Development Status :: 4 - Beta", # change to `5 - Production/Stable` when ready
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
]
dependencies = [
"gym>=0.15.4",
"mujoco-py<2.2,>=2.0",
"numpy>=1.18",
"scipy>=1.4.1",
]
dynamic = ["version"]

[project.optional-dependencies]
# Update dependencies in `all` if any are added or removed
testing = [
"ipdb",
"memory_profiler",
"pylint", # TODO: remove in favor of precommit?
"pyquaternion==0.9.5",
"pytest>=4.4.0", # Required for pytest-xdist
"pytest-xdist",
"pytest-cov", #TODO: test this
"pre-commit", #TODO: test this
]

[project.urls]
Homepage = "https://farama.org"
Repository = "https://github.com/Farama-Foundation/Metaworld"
Documentation = "https://meta-world.github.io/"
"Bug Report" = "https://github.com/Farama-Foundation/Metaworld/issues"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
include = ["metaworld", "metaworld.*"]

# Linters and Test tools #######################################################

[tool.black]
safe = true

[tool.isort]
atomic = true
profile = "black"
src_paths = ["metaworld", "tests"]

[tool.pyright]
# add any files/directories with type declaration to include
include = [
"metaworld/",
]
strict = [
]
verboseOutput = true
typeCheckingMode = "basic"
reportMissingImports = false
# TODO: fix these
reportUnboundVariable = false
reportOptionalMemberAccess = false
reportGeneralTypeIssues = false
reportOptionalSubscript = false

[tool.pytest.ini_options]
norecursedirs = [
"metaworld"
]
45 changes: 16 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
from setuptools import find_packages, setup
"""Sets up the project."""

# import pathlib

# Required dependencies
required = [
# Please keep alphabetized
"gym>=0.15.4",
"mujoco-py<2.2,>=2.0",
"numpy>=1.18",
"scipy>=1.4.1",
]
from setuptools import setup

# CWD = pathlib.Path(__file__).absolute().parent
#
#
# def get_version():
# """Gets the metaworld version."""
# path = CWD / "metaworld" / "__init__.py"
# content = path.read_text()
#
# for line in content.splitlines():
# if line.startswith("__version__"):
# return line.strip().split()[-1].strip().strip('"')
# raise RuntimeError("bad version data in __init__.py")

# Development dependencies
extras = dict()
extras["dev"] = [
# Please keep alphabetized
"ipdb",
"memory_profiler",
"pylint",
"pyquaternion==0.9.5",
"pytest>=4.4.0", # Required for pytest-xdist
"pytest-xdist",
]


setup(
name="metaworld",
version="0.1.0",
packages=find_packages(),
include_package_data=True,
install_requires=required,
extras_require=extras,
)
setup(name="metaworld", version="2.0.0")

0 comments on commit cb871e5

Please sign in to comment.