FixOurFood / AgriFoodPy

Collection of methods to handle food data
https://agrifoodpy.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

Start using poetry for package management? #7

Open sarahbridle opened 2 years ago

sarahbridle commented 2 years ago

I'm just pip installing rasterio, but wondering if there is an easy way to log this change / make it simple for future users - perhaps poetry?

[note to self - we're using conda here not pip, don't mix. do conda install rasterio instead]

or how do I edit the FOF setup?

sarahbridle commented 2 years ago
kaedonkers commented 1 year ago

My insight on this would be to use Conda to install all packages and create two files to capture the environments:

  1. environment.yaml -> A streamlined manifest of packages which is human readable (which you've already done)
  2. env.lin64.lock -> An exact specification of all the packages, with their versions and software, to exactly recreate the environment. This can also be done for win64 and osx64 operating systems to ensure that multiple platforms are catered for.
kaedonkers commented 1 year ago

Having said that, you can include pip packages in a conda environment if you found that there were packages or package versions that were only sourced from pip and not conda.

For example the environment.yaml could look like:

name: conda-env
dependencies:
  - python
  - pandas
  - pip
  - pip:
    - rasterio
kaedonkers commented 1 year ago

In terms of Poetry, it looks like this is more aimed at building Python packages. It is definitely an option, and might be worth considering if we reframe this as an explicit python package, but there is nothing that Poetry does that conda doesn't (as far as I know)

kaedonkers commented 1 year ago

More info here: https://medium.com/semantixbr/getting-started-with-conda-or-poetry-for-data-science-projects-1b3add43956d