JohnCRuf / alderman_machine

This is the repository for a research project investigating clientelistic politics in Chicago
3 stars 2 forks source link

Python package management is FUBAR #18

Open JohnCRuf opened 1 year ago

JohnCRuf commented 1 year ago

currently the code to setup the python package management is FUBAR. I should be setting up a virtual environment and using that.

JohnCRuf commented 1 year ago

Assigning this to both Thomas and me because we need to figure out proper Python package management to make this repo replicable.

tmalthouse commented 1 year ago

I'm managing my env through conda—assuming it's OK with you, I can upload the relevant environment.txt to the repo and we can share that going forward. Also happy to transition back to pip/virtualenv if there's benefit to doing so.

JohnCRuf commented 1 year ago

Yeah that works, honestly anything is better than the unworkable mess that is currently on the repo.

The big thing is to create a python script that automatically installs any package that's required for the project. As long as conda can automatically install a set of packages (eg. if it automatically updates to install everything inside of environment.txt) then that's perfect.

tmalthouse commented 1 year ago

Cool cool—Conda can (in theory) replicate a given environment (w/ versions pinned down) from the environment.txt. Doesn't actually work that cleanly in practice, but I don't think we're using any especially unusual packages. Importantly: I'm fairly sure everything we use is on Conda, so we don't have to mix that and PyPI.

JohnCRuf commented 1 year ago

Perfect, I've spent way too much time trying to make venv work, but I'm not an expert programmer.

If you think you can do it, feel free to set up a PR when you have a chance. Otherwise, if you got a good guide to how to use conda for project management I can do it over the weekend.

Right now I want to close in on getting the new DiD and Bernie stone case study results together so I can pivot to primarily working on the GRE.

JohnCRuf commented 1 year ago

@tmalthouse any progress on this?