njcuk9999 / lbl

Line by line code for radial velocity
MIT License
15 stars 3 forks source link

Make lbl installable with pip #17

Closed vandalt closed 2 years ago

vandalt commented 2 years ago

The goal of this is to make the repo installable with pip (either locally or with git+ syntax, PyPI publication is a separate topic).

I added metadata to setup.cfg and copied the dependencies from requirements.txt. I'm still testing the installation on UdeM machines so I'll mark this as draft for now (it seems I can't mark as draft because merge is blocked by reviews anyway).

A couple questions I have:

njcuk9999 commented 2 years ago

So for requirements short answer no, I'd rather keep them as exact - many modules end up breaking something after and that is more support/hassle than I'm willing to provide (we don't have unit tests to test new modules when they come in - so you will get a lot of problems with supporting package combinations). Users should be encouraged to use a dedicated conda or venv environment.

Currently, we have some in the git directory in the lbl.doc.examples.tests - obviously to use from the command line you will need a yaml file. How does the inclusion of data files work - where do they go? how does one define them?

vandalt commented 2 years ago

Users should be encouraged to use a dedicated conda or venv environment.

I agree. The main downside of pinned versions is that LBL might be lagging on the latest Python version, but that's pretty common and not a big issue. Unit tests might help with that later.

Currently, we have some in the git directory in the lbl.doc.examples.tests - obviously to use from the command line you will need a yaml file. How does the inclusion of data files work - where do they go? how does one define them?

The files will be downloaded with the package at the location they are by default. We can specify a different path at installation. But if these are only examples and not used by default, we don't necessarily need to include them with the instal. We can just document that they are on github (and in the docs eventually), and explain to users how to create their own.

njcuk9999 commented 1 year ago

@vandalt One thing we forget with this PR is to update the README with the installation instructions.

Could you just confirm to me how we now install?

  1. set up environment (i.e. conda create --name lbl-env python=3.8)
  2. activate environment (conda activate lbl-env)
  3. download git (git clone git@github.com:njcuk9999/lbl.git)
  4. ???

What is step 4 now? (it used to be pip install -r requirements and then set the paths)

vandalt commented 1 year ago

cd in the repo and python -m pip install -U -e . (the -e is to make the install editable. For regular users, it is not required)