HexHive / retrowrite-dev

Retrowrite Development (Internal) Repository
7 stars 2 forks source link

Remove virtualenv from git #5

Closed diagprov closed 3 years ago

diagprov commented 3 years ago

Inside the repository we have the retro directory, which is an entire virtual environment committed to git.

The purpose of virtualenv is to be able to create a python environment isolated from your system one, with possibly overridden packages. End-users of retrowrite may want to create a virtualenv for their project, and then import the retrowrite package into it using pip install, or directly from their filesystem using setup.py.

This makes development a little inconvenient, since you can end up having to reinstall to your local virtualenv repeatedly once installed. This can be avoided by uninstalling the package from the virtualenv and letting python find the code in your current directory, i.e. by finding librw/__init__.py.

The setup.py file should be able to install retrowrite successfully.

The issue with keeping the retro directory is this: changes risk accidentally being committed to this directory. We all work on different linux distributions. It will begin to not work if we deal with cypthon dependencies that are python extensions and arch-dependent. It is generally just a bit messy.

louismerlin commented 3 years ago

Something I like to see in projects (and do in mine when applicable) is provide a Dockerfile and the relevant commands (in a Makefile) that can be run to use the project on a computer that has docker installed. This creates an OS-independent way to use a project, and reduces dependency errors. Plus, an automated testing system can use the docker environment for reproducible builds.

With a solution like this, there would be no more need for any virtualenv config in the project.

Would you like me to submit a PR with a basic Dockerfile+Makefile combo for retrowrite ? I've done this many times for my personal projects, and it would not take much work.

gannimo commented 3 years ago

The Dockerfile is a really nice idea. If you can create Dockerfiles to setup retrowrite and provide some running examples would be awesome and an easy way to reproduce/test different configurations! So, yes please if you have good experience making them!

diagprov commented 3 years ago

I'm going slightly insane, retro is in fact not in git. It is in fact in gitignore. But we seem to have code that assumes it is in git. Unfortunately python does not have a very nice "deployment story".

So yes I also agree, dockerfile is a great idea!