-
Notifications
You must be signed in to change notification settings - Fork 71
Move to a conda only install of pymc (local dev workflow) #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
044a4ec
57583ad
d2b7991
7d01812
47eb72c
16fc8e4
ad76c04
f87094a
abab314
4c65c01
2bf31e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: CausalPy | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- arviz>=0.14.0 | ||
- graphviz | ||
- ipython!=8.7.0 | ||
- matplotlib>=3.5.3 | ||
- numpy<1.26.0 | ||
- pandas | ||
- patsy | ||
- pymc>=5.0.0 | ||
- scikit-learn>=1 | ||
- scipy | ||
- seaborn>=0.11.2 | ||
- statsmodels | ||
- xarray>=v2022.11.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the problem comes because you are deleting these dependencies and you are pip installing the package in the CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can try to mimic the way is done in https://github.com/pymc-devs/pymc-experimental/blob/main/.github/workflows/test.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that experienced with GitHub workflows. What am I looking for? Are you referring to the
environment-file:
in thewith:
block?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean concretely: https://github.com/pymc-devs/pymc-experimental/blob/main/.github/workflows/test.yml#L16-#L70 Here they are installing the conda env and installing the library. However, I see that they have a
setup.py
so this might not apply to this case 🙈How I see it
environment.yml
is a specification of an environment but you still need to indicate de package dependencies and I think this is why the tests are failing unless you keep thedependencies = [ ... ]
in thepyproject.toml
. Maybe @maresb has a hint on how to make this cleaner?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I'm on vacation now, but we should discuss (and update) #281.
As for Conda vs pyproject dependencies, ideally we keep both. Pyproject dependencies define the python-only dependencies that you have. On the other hand, Conda takes care of both Python and non-Python dependencies.
I haven't read carefully any of the details, so I may be missing stuff, but the way I like to handle this is to:
pip install
the project into the Conda environment with the--no-dependencies
flag so thatpip
installs only the projectpip check
to ensure all of the project's Python dependencies are satisfied within the Conda environment. This will trip on the case when you declare a Python dependency inpyproject.toml
that is missing from yourenvironment.yaml
file. I don't really know of any tests that go in the other direction, and I don't know that it would even make sense.Note that this means that your primary source of truth for a project's dependencies should be the
pyproject.toml
file, not theenvironment.yaml
file! I think this is how it should be. It enables masochistic "experts" to do an unsupportedpip install
if they are so inclined.Regarding #281,
conda-lock
can parse thepyproject.toml
for the requirements and generate a lockfile, so apart from specifying special requirements, we may be able to replace theenvironment.yml
with a lockfile.