autonlab / auton-survival

Auton Survival - an open source package for Regression, Counterfactual Estimation, Evaluation and Phenotyping with Censored Time-to-Events
http://autonlab.github.io/auton-survival
MIT License
315 stars 74 forks source link

Add pyproject.toml to root dir to facilitate install as VCS or local dependency #115

Closed matteo4diani closed 1 year ago

matteo4diani commented 1 year ago

I have been testing this package out recently and was able to install it with pip by creating a pyproject.toml in the repo root directory so it could be installed using setuptools:

[project]
name = "auton_survival"
version = "1.0.0"
description = "the auton-survival package"
license = {file = "LICENSE"}
readme = "README.md"
dependencies = [
    "torch>=1.0.0",
    "numpy>=1.16.5",
    "pandas>=1.0.0",
    "tqdm>=4.0.0",
    "scikit-learn>=0.18",
    "torchvision>=0.7.0",
    "scikit-survival>=0.15.0",
    "lifelines>=0.26.4",
]

[build-system]
requires = [
    "setuptools",
    "wheel",
]

[tool.setuptools]
packages = ["auton_survival"]

Had no trouble installing and using things after that with pip install -q -e ~/auton-survival. With this approach you guys could get rid of your requirements.txt and just stick the dependencies in this file too. Here's some of the relevant documentation if you're interested in learning more. Longer-term, I'd suggest you guys use a build tool like poetry which manages dependencies, installations, virtual environments, and can even push to PyPI (so people can do pip installs without cloning the repo).

Originally posted by @ecotner in https://github.com/autonlab/auton-survival/issues/87#issuecomment-1226562807

matteo4diani commented 1 year ago

I am looking into possible solutions for a federated learning application and having replicable deployments is a must. It looks like this comment already offers a viable and easily maintainable solution.

By adding a simple pyproject.toml descriptor to your root dir it would be easier to add auton-survival via VCS / local dependencies through poetry or PDM: https://python-poetry.org/docs/dependency-specification/#git-dependencies

Would you mind if I worked out a PR with the updated pyproject.toml? I can take care of maintaining it šŸ™šŸ¼