-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add README for scripts folder #76
Conversation
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.
Ran through the instructions and it worked great. Thanks!
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.
Tried it and works well for me also
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.
@kylebarron thanks for adding some instructions!
|
||
To install Poetry, follow the Poetry [installation guide](https://python-poetry.org/docs/#installation). | ||
|
||
To install from the lockfile, run `poetry update`. |
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.
Is this poetry update
step supposed to create a new environment?
Because that doesn't seem to be what it is doing, in the way I tried it. We have a conda environment.yml file in the examples/ directory to create the example.parquet file. And so that environment was activated when, after updating the example, I ran those instructions. And it seems to have updated my conda installation instead of creating a separate virtual environment.
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.
🤦♂️ Sorry, I wrote this doc too quickly. To install from a lockfile you use poetry install
, not poetry update
. The latter updates the lockfile with new dependencies (but still constrained to the semver dependencies in pyproject.toml
).
I don't use Conda so I'm not familiar of any ways Poetry could interact with it. One way to check how Poetry is behaving is by setting the config settings to create a virtualenv in the project directory:
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
Then when I run poetry install
within scripts/
I see this:
> poetry install
Creating virtualenv geoparquet-scripts in /Users/kyle/github/mapping/geoparquet/scripts/.venv
Installing dependencies from lock file
Package operations: 2 installs, 0 updates, 0 removals
• Installing numpy (1.22.3)
• Installing pyarrow (7.0.0)
And then you should see a .venv
directory in the local directory, and be able to open that environment (even outside of poetry run
) with a normal source ./.venv/bin/activate
.
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.
That said, I suggested this setup because it's what I'm most familiar with, but it's ok if the project standardizes on another system. Mostly I like having the reproducibility of lockfiles while only needing to strictly define top-level dependencies (see: ref1, ref2). Poetry, Pipenv, and pip-compile+requirements.txt+virtualenv all have similar goals.
We could explore conda-lock.
For #68 (comment)