Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It should be possible to create a Wagon file for requirement files without source #30

Open
andythomas501 opened this issue Apr 14, 2016 · 8 comments
Milestone

Comments

@andythomas501
Copy link

I have a requirements file for a bunch of packages I want to install on some servers. I want to use Wagon to easily package and install them. However, Wagon forces me to select a "source" package. I can arbitrarily select one of the packages I want to install, specify it as "soruce", and remove it from the requirement files (to avoid a duplication error), but I think it would be best if I could just use Wagon to "archive" a list of unrelated packages.

@nir0s
Copy link
Contributor

nir0s commented Apr 16, 2016

So, you'd expect to send a requirements file as an "argument" to wagon, it will download all wheels and put them in a single wgn. Is this right?

How should the metadata reflect this from your POV?

@andythomas501
Copy link
Author

I don't really mind what's in the metadata.

@nir0s
Copy link
Contributor

nir0s commented Jul 7, 2016

Note that we're working on a redo for Wagon and will try to include this feature in the new version.

@nir0s
Copy link
Contributor

nir0s commented Nov 21, 2016

Sorry, but it seems we'll only be able to promote this with version v1.0.0 which has an unknown release date.

@nir0s nir0s added this to the v1.0.0 milestone Jan 6, 2017
@ncoghlan
Copy link

I have a similar need when generating a wagon archive to include in a larger installation bundle, but came up with a workaround I'm happy with, which is to create a minimal dev/setup.py file, then run:

wagon create -r locked-requirements.txt -f -t tar.gz dev

The minimal setup.py file is just:

"""Python pseudo-package for install bundle generation"""

from distutils.core import setup

setup(
    name="my_company_python_deploy_bundle",
    version="1",
    description="Pseudo-package for Python install bundle generation",
    author="<My company> <My project> development team",
    packages=[],
)

This is enough to give wagon the info it needs to generate the bundle filename (i.e. my_company_python_deploy_bundle-1-...) without needing to define a full publishable Python package.

@ncoghlan
Copy link

ncoghlan commented Mar 19, 2018

After further experimentation, I discovered a problematic bug when SOURCE is given as a relative local directory: wagon still tries to go and grab a project of the same name from PyPI.

So in my dev example above, I was ending up with a copy of https://pypi.org/project/dev/ in the created wagon archive.

Switching the local relative to source directory to install instead results in an error.

To make sure wagon doesn't try to check PyPI there needs to be a directory separator in the local path reference:

wagon create -r locked-requirements.txt -f -t tar.gz ./install

@nir0s
Copy link
Contributor

nir0s commented Mar 19, 2018

This is actually by design, much like with pip, you should be able to provide just a "name", which will be looked up in PyPi, and a local path. Would you have expected something else?

@ncoghlan
Copy link

I'm also interested in app deployment and "standard development environment" type use cases, where wagon is being used to define a managed environment used for application deployment. My specific use case is setting up a shared Python env in an embedded Linux deployment where we have multiple standalone scripts that are rolled out as part of a mostly self-installing firmware update tarball rather than as a Python package. We'll also see a similar situation if folks want to create a wagon from a pipenv-managed application.

The setup.py pseudo-package approach already works (thank you!), so I don't think there's any urgent need for enhancements here, but I do think the UX would be clearer if there was an option to specify the required metadata from the command line (either directly or by specifying a static config file), rather than specifying it indirectly via an executable setup.py script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants