Skip to content

Commit

Permalink
Setup py (#31)
Browse files Browse the repository at this point in the history
* trying to fix readthedocs v3

* trying to fix readthedocs v3

* release bump

* fixing setup
  • Loading branch information
tabacof authored Dec 6, 2023
1 parent db111c9 commit 72b1d7f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustrees"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
authors = [
"Guilherme Lázari <[email protected]>",
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ econml
seaborn
black
ruff
toml
37 changes: 24 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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="[email protected], [email protected]",
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",
Expand All @@ -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/",
Expand Down

0 comments on commit 72b1d7f

Please sign in to comment.