From 91a5f3869f1d72c7d7240e0d9e6376c4d4c41cb7 Mon Sep 17 00:00:00 2001 From: Mikel Date: Wed, 4 Sep 2024 11:10:54 +0200 Subject: [PATCH] Update setup.py, pyproject.toml, and dependencies --- craftium-docs/installation.md | 2 +- craftium-readme.md | 2 +- pyproject.toml | 8 ++++++-- requirements.txt | 11 +++++++---- setup.py | 10 +++++++--- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/craftium-docs/installation.md b/craftium-docs/installation.md index 1f231886b..fc388d713 100644 --- a/craftium-docs/installation.md +++ b/craftium-docs/installation.md @@ -17,7 +17,7 @@ sudo apt install g++ make libc6-dev cmake libpng-dev libjpeg-dev libgl1-mesa-dev Besides these libraries, craftium requires Python's header files to build a dedicated Python module implemented in C (`mt_server`). In Debian/Ubuntu (the name of the package might slightly differ depending on the distro): ```bash -sudo apt install python3-dev +sudo apt install libpython3-dev ``` Once system dependencies are installed, check that `setuptools` is updated and run the installation command in the craftium repo's directory: diff --git a/craftium-readme.md b/craftium-readme.md index 5049c0414..831235d3d 100644 --- a/craftium-readme.md +++ b/craftium-readme.md @@ -54,7 +54,7 @@ sudo apt install g++ make libc6-dev cmake libpng-dev libjpeg-dev libgl1-mesa-dev Additionally, `craftium` requires Python's header files to build a dedicated Python module implemented in C (`mt_server`): ```bash -sudo apt install python3-dev +sudo apt install libpython3-dev ``` Then, check that `setuptools` is updated and run the installation command in the craftium repo's directory: diff --git a/pyproject.toml b/pyproject.toml index 91699df7a..20137c19b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["setuptools"] build-backend = "setuptools.build_meta" +requires = ["numpy==2.0.1", "setuptools==66.1.1", "pybind11==2.13.1"] [project] name = "craftium" @@ -11,7 +11,11 @@ license = {file = "LICENSE.txt"} keywords = ["gymnasium", "minetest", "minecraft", "reinforcement learning"] dependencies = [ - "stable_baselines3", + "gymnasium==0.29.1", + "PyYAML==6.0.1", + "stable_baselines3==2.3.2", + "torch==2.1.0", + "tyro==0.8.5", ] [tool.setuptools.packages.find] diff --git a/requirements.txt b/requirements.txt index 83ca8acd6..fb924764e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,8 @@ -numpy==1.25.2 -matplotlib==3.8.0 -torch==2.1.0 -stable_baselines3==2.3.2 gymnasium==0.29.1 +numpy==2.0.1 +PyYAML==6.0.1 +setuptools==66.1.1 +stable_baselines3==2.3.2 +torch==2.1.0 +tyro==0.8.5 +pybind11==2.13.1 diff --git a/setup.py b/setup.py index b03c2a0a3..6c33760a7 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,8 @@ import os import shutil -from setuptools import setup import subprocess - +from setuptools import setup, Extension +import numpy def build_minetest(): subprocess.check_call(["cmake", ".", "-DRUN_IN_PLACE=TRUE", "-DCMAKE_BUILD_TYPE=Release"]) @@ -44,4 +44,8 @@ def setup_irr_shaders_dir(): create_data_dir() -setup() +module = Extension("mt_server", + sources=["mt_server.c"], + include_dirs=[numpy.get_include()]) + +setup(ext_modules=[module])