Skip to content
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

Merged
merged 1 commit into from
Apr 22, 2022

Conversation

kylebarron
Copy link
Collaborator

Copy link
Member

@cholmes cholmes left a 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!

@cholmes cholmes added this to the 0.3 milestone Apr 22, 2022
Copy link
Collaborator

@felixpalmer felixpalmer left a 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

@cholmes cholmes merged commit f2a01cc into opengeospatial:main Apr 22, 2022
Copy link
Collaborator

@jorisvandenbossche jorisvandenbossche left a 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`.
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

@kylebarron kylebarron mentioned this pull request Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants