Version in pyproject.toml is now single source of truth

This commit is contained in:
Dominik Moritz Roth 2024-02-10 10:13:17 +01:00
parent 5aec4f835f
commit 259b13baa1
2 changed files with 13 additions and 4 deletions

View File

@ -1,13 +1,17 @@
# This conf.py is in large parts inspired by the oen used by stable-baselines 3
import toml
import datetime
project = 'Fancy Gym'
author = 'Fabian Otto, Onur Celik, Dominik Roth, Hongyi Zhou'
copyright = f'2020-{datetime.date.today().year}, {author}'
release = '0.2' # The full version, including alpha/beta/rc tags
version = '0.2' # The short X.Y version
pyproject_content = toml.load("../../pyproject.toml")
proj_version = pyproject_content["project"]["version"]
release = proj_version # The full version, including alpha/beta/rc tags
version = proj_version # The short X.Y version
extensions = [
'myst_parser',

View File

@ -1,5 +1,6 @@
# We still provide a setup.py for backwards compatability.
# But the pyproject.toml should be prefered.
import toml
import itertools
from pathlib import Path
from typing import List
@ -8,6 +9,9 @@ from setuptools import setup, find_packages
print('[!] You are currently installing/building fancy_gym via setup.py. This is only provided for backwards-compatability. Please use the pyproject.toml instead.')
pyproject_content = toml.load("pyproject.toml")
project_version = pyproject_content["project"]["version"]
# Environment-specific dependencies for dmc and metaworld
extras = {
'dmc': ['shimmy[dm-control]', 'Shimmy==1.0.0'],
@ -38,7 +42,7 @@ def find_package_data(extensions_to_include: List[str]) -> List[str]:
setup(
author='Fabian Otto, Onur Celik, Dominik Roth, Hongyi Zhou',
name='fancy_gym',
version='0.1.0',
version=project_version,
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
@ -55,6 +59,7 @@ setup(
],
extras_require=extras,
install_requires=[
'toml',
'mp_pytorch<=0.1.3',
'mujoco==2.3.3',
'gymnasium[mujoco]>=0.26.0'