Skip to content

Commit

Permalink
Update setup.py, pyproject.toml, and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikel committed Sep 4, 2024
1 parent 4daf1d3 commit 91a5f38
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion craftium-docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion craftium-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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]
Expand Down
11 changes: 7 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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"])
Expand Down Expand Up @@ -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])

0 comments on commit 91a5f38

Please sign in to comment.