diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 50f7c43..5c28715 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,6 +12,8 @@ build: python: "3.11" rust: "1.70" commands: + - python -m venv .env + - source .env/bin/activate - pip install -r requirements.txt - maturin develop --release diff --git a/Cargo.toml b/Cargo.toml index f6abc00..bfb8426 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustrees" -version = "0.2.2" +version = "0.2.3" edition = "2021" authors = [ "Guilherme Lázari ", diff --git a/requirements.txt b/requirements.txt index 2dd84a0..81a19e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ econml seaborn black ruff +toml diff --git a/setup.py b/setup.py index 169ebeb..290956e 100644 --- a/setup.py +++ b/setup.py @@ -1,23 +1,34 @@ +import toml from setuptools import find_packages, setup +with open("Cargo.toml", "r") as file: + cargo_toml = toml.load(file) + +with open("pyproject.toml", "r") as file: + pyproject_toml = toml.load(file) + +package_name = cargo_toml["package"]["name"] +version = cargo_toml["package"]["version"] +description = cargo_toml["package"].get("description", "") +license_type = cargo_toml["package"].get("license", "") +authors = cargo_toml["package"].get("authors", []) +authors_str = ", ".join(authors) + +dependencies = pyproject_toml["project"]["dependencies"] +build_requires = pyproject_toml["build-system"]["requires"] + setup( - name="rustrees", - version="0.2.0", - description="Efficient decision tree and random forest library written in Rust with Python bindings", + name=package_name, + version=version, + description=description, long_description=open("README.md").read(), long_description_content_type="text/markdown", - author="Pedro Tabacof, Guilherme Lázari", - author_email="tabacof@gmail.com, guilhermelcs@gmail.com", + author=authors_str, url="https://github.com/tabacof/rust-trees", - license="MIT", + license=license_type, packages=find_packages(), include_package_data=True, - install_requires=[ - "numpy>=1.0", - "pandas>=2.0", - "scikit-learn>=1.0", - "pyarrow>=12.0", - ], + install_requires=dependencies, classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", @@ -31,7 +42,7 @@ "Topic :: Scientific/Engineering :: Artificial Intelligence", ], python_requires=">=3.6", - setup_requires=["maturin>=1.0,<2.0"], + setup_requires=build_requires, zip_safe=False, project_urls={ "Documentation": "https://rust-trees.readthedocs.io/en/latest/",