Closed harpaj closed 3 years ago
Great suggestion! Do think you can send us a PR with that, no pressure if you can't but it sounds like you got a good idea of what to do and we love community contributions!
@harpaj yeah i agree we have to figure our a good way to not ship our dev dependencies
In the meantime as a workaround, you can install jake to the system and evaluate site packages external to the shell with jake installed using the target flag and passing in a site-packages array.
This section of the readme describes how to do that by storing them into an env variable:
To get the site packages available to a virtual environment:
$ source .venv/bin/activate
(.venv) $ python -m site
sys.path = [
'/home/ButterB0wl/git_repos/jake',
'/usr/lib/python37.zip',
'/usr/lib/python3.7',
'/usr/lib/python3.7/lib-dynload',
'/home/ButterB0wl/git_repos/jake/.venv/lib/python3.7/site-packages',
]
USER_BASE: '/home/ButterB0wl/.local' (exists)
USER_SITE: '/home/ButterB0wl/.local/lib/python3.7/site-packages' (exists)
ENABLE_USER_SITE: False
The -t argument accepts a list as a string literal. This is the best way I've found to do this, if you find a better way please create an issue :)
Run the python command using the shell you want to target and export to an env var:
# using target python shell for system or virtual environment
$ export JAKE_TARGET=`python -c "import site; print(site.getsitepackages())"`
# using whatever shell has access to the jake module, can be a global install or stand-alone virtual environment
$ jake ddt -t "$JAKE_TARGET"
In other words: activate the virtual environment, run the site.getsitepackages() command, and make the output accesible to your jake install
Is that something that you manage through setup.py or do you use some sort of package management on top of pip? (I've seen pipenv and poetry for example and they can separate those out)
If you have an example where another project is doing what you would consider optimal that would be awesome
Is anyone working on this? It looks like there are still a lot of unnecessary dependencies for install_requires
. I’d be happy to give this a shot if no one else is!
@jwa5426 Go for it!
In case it helps, we started a "dev only" list of requirements here: requirements-dev.txt
Not sure if some items in requirements.txt should be moved to dev or not.
A heads-up, in case it matters, I also tried to improve version dependency things a bit via this PR #57
@bhamail Cool, I’ll wait for that to merge before I try moving the dev dependencies.
What are you trying to do? The list of dependencies that is installed together with Jake at the moment is extremely long. Not all of these requirements are needed for running Jake, but only for its development.
What feature or behavior is this required for? Having a lightweight environment to run Jake from, e.g. as part of a CI process.
How could we solve this issue? (Not knowing is okay!) Revising the list of dependencies installed via
install_requires
, only including the minimum set necessary for running Jake. Other dependencies can be moved totests_requires
, if they are necessary to run the tests.Anything else? As a follow-up step, it might make sense to relax the defined versions, to make Jake play nicer with other projects installed in the same repo.
cc @bhamail / @DarthHater