From 03080789db6b5c8482da1b857ec9615f0103cbbd Mon Sep 17 00:00:00 2001 From: Shravan Tata Date: Sun, 17 Aug 2025 14:27:40 -0400 Subject: [PATCH 1/2] [MAIN] Added pyproject toml setup for pep517 --- pyproject.toml | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 58 +++++++++++++++++++--------------------------- 2 files changed, 87 insertions(+), 34 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..839046d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = [ + "setuptools", "numpy <= 1.26.4", "Cython>=0.15.1" +] +build-backend = "setuptools.build_meta" + +[project] +version = "0.1.0" +name = "farms_bullet" +description = "FARMS package for running simulations with Bullet physics" +readme = "README.md" +license = "Apache-2.0" +license-files = ["LICENSE"] +requires-python = ">= 3.11" +dependencies = [ + "numpy <= 1.26.4", + "matplotlib", + "cython", + "scipy", + "tqdm", + "trimesh", + "pybullet", + "imageio", + # "farms_core @ git+https://github.com/farmsim/farms_core.git", + # "farms_sim @ git+https://github.com/farmsim/farms_sim.git", +] +keywords = ["farms", "framework", "animals", "robot", " modeling", "simulation"] +classifiers = [ + "Development Status :: 3 - Beta", + # Indicate who your project is intended for + "Intended Audience :: Science/Research", + "ScieTopic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Artificial Life", + # Specify the Python versions you support here. + "Programming Language :: Python :: 3.11", +] + +[project.urls] +Homepage = "https://farmsim.dev" +Documentation = "https://farmsim.dev" +Repository = "https://github.com/farmsim/farms_bullet.git" +Issues = "https://github.com/farmsim/farms_bullet/issues" +Changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md" + +[project.optional-dependencies] +analysis = [] + +[tool.setuptools.packages.find] +# This is equivalent to find_packages() with no arguments + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.package-dir] +farms_bullet = "farms_bullet" + +[tool.setuptools.package-data] +farms_bullet = [ + "*.pxd", + "sensors/*.pxd", + "swimming/*.pxd" +] \ No newline at end of file diff --git a/setup.py b/setup.py index 5ec1113..b32bb7a 100755 --- a/setup.py +++ b/setup.py @@ -1,37 +1,37 @@ -#!/usr/bin/env python """Setup script""" -from setuptools import setup, find_packages -from setuptools.extension import Extension -from setuptools import dist - -dist.Distribution().fetch_build_eggs(['numpy']) import numpy as np +from Cython.Build import cythonize # pylint: disable=wrong-import-position +from Cython.Compiler import Options # pylint: disable=wrong-import-position +from farms_core import get_include_paths # pylint: disable=wrong-import-position +from setuptools import setup +from setuptools.extension import Extension -dist.Distribution().fetch_build_eggs(['Cython>=0.15.1']) -from Cython.Build import cythonize - -dist.Distribution().fetch_build_eggs(['farms_core']) -from farms_core import get_include_paths +# Cython options DEBUG = False +Options.docstrings = True +Options.embed_pos_in_docstring = False +Options.generate_cleanup_code = False +Options.clear_to_none = True +Options.annotate = False +Options.fast_fail = False +Options.warning_errors = False +Options.error_on_unknown_names = True +Options.error_on_uninitialized = True +Options.convert_range = True +Options.cache_builtins = True +Options.gcc_branch_hints = True +Options.lookup_module_cpdef = False +Options.embed = None +Options.cimport_from_pyx = False +Options.buffer_max_dims = 8 +Options.closure_freelist_size = 8 setup( name='farms_bullet', - version='0.1', - author='farmsdev', - author_email='biorob-farms@groupes.epfl.ch', - description='FARMS package for running simulation with the Bullet engine', - keywords='farms simulation bullet', - packages=find_packages(), - package_dir={'farms_bullet': 'farms_bullet'}, - package_data={'farms_bullet': [ - f'{folder}/*.pxd' - for folder in ['sensors', 'swimming'] - ]}, - include_package_data=True, - include_dirs=[np.get_include()], + include_dirs=[np.get_include()] + get_include_paths(), ext_modules=cythonize( [ Extension( @@ -57,14 +57,4 @@ } ), zip_safe=False, - install_requires=[ - 'farms_core', - 'cython', - 'numpy', - 'scipy', - 'matplotlib', - 'tqdm', - 'trimesh', - 'pybullet', - ], ) From 63c4d1aac6095d2a0bf98e65b3c5170abe041834 Mon Sep 17 00:00:00 2001 From: Shravan Tata Date: Thu, 21 Aug 2025 14:07:42 -0400 Subject: [PATCH 2/2] [SETUP] Added farms dependencies in pyproject --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 839046d..4226d7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,8 +21,8 @@ dependencies = [ "trimesh", "pybullet", "imageio", - # "farms_core @ git+https://github.com/farmsim/farms_core.git", - # "farms_sim @ git+https://github.com/farmsim/farms_sim.git", + "farms_core", + "farms_sim", ] keywords = ["farms", "framework", "animals", "robot", " modeling", "simulation"] classifiers = [