-
Notifications
You must be signed in to change notification settings - Fork 35
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
Make the template installable from PyPI #23
Comments
I've had a go at this. What I've done is to create a skeleton package - this contains only the minimal files and folders required to generate a project template. I've then created a package that includes all these files and folders, alongside a CLI interface. Need to write some docs, and tests (not sure how at the moment, so any pointers would be grand!) You can test this in the interim, as I've pushed something onto Test PyPI. Do the following in your terminal (ideally in a Python virtual environment): pip install click cookiecutter # needed as the dependencies may not be on Test PyPI
pip install -i https://test.pypi.org/simple/ govcookiecutter
govcookiecutter You should then see the prompts! I've branched this off PR #33, which is currently in review. @foster999 not sure if you're still looking for this but tagging @alexander-newton as well. |
Create a Python package with the minimum folders and files required to create a project from `govcookiecutter` using a CLI. By executing: ``` python setup.py build_package ``` a universal source and wheel distribution of this skeleton package is created. `pip` install the package, and then run `govcookiecutter` in your terminal. Should fix issue #23.
Thanks @ESKYoung, this sounds perfect! I'm not sure if we mirror Test PyPI, but I'll give it a try on and off network to make sure it works in principle 👍 On the testing front, pytest has a neat fixture |
Thanks @foster999 - let me know how it goes. On the test front, you're right - that's the way to go. I may not have time to complete this feature, but for reference I'm thinking:
Should be straight forward to use all the default inputs (use the However, this should all be mitigated by the fact this is strictly a series of integration tests (arguments are passed to Testing that the |
Works nicely off-network - will give it a try internally once it's on PyPI, but I can't see there being any issue 😀 I'd agree that there's minimal gain to be had from testing the CLI options. The testing looks thorough in the main template and the parameters map one-to-one into cookiecutter, so there's very little that could go wrong. A test to assert that all of the cookiecutter parameters (could access these from the function object) have CLI equivalents could be useful for keeping them aligned? But otherwise, just ensuring the default options run successfully sounds good. Reversing the logic for selecting files sounds sensible to me too! |
Thanks @foster999 for confirming! I don't think I'll have time now to work on this further, so feel free to takeover! I've rebased the branch up to version 1.2.2 of I've had a rethink about reversing the logic for selecting files. Although more automated, there's a risk that it'll automatically transfer over folders/files that may be unwanted. I briefly tried it out and, for example, it transferred over my |
Oh and the version number in |
Create a Python package with the minimum folders and files required to create a project from `govcookiecutter` using a CLI. By executing: ``` python setup.py build_package ``` a universal source and wheel distribution of this skeleton package is created. `pip` install the package, and then run `govcookiecutter` in your terminal. Should fix issue #23.
Issue
At the ONS, our data access platform (DAP) doesn't have access to the web and the process for moving files in and out is non-trivial. However, we can install packages via our Artifactory instance, which mirrors PyPI.
Solution
Would it be possible to make the template available at a data-only package on PyPI?
I'm not certain how we would then run
cookiecutter
with the template, other than pointing to the resources in site-packages. But at least we'd be able to make use of it.Alternatives
We might be able to request to mirror specific GitHub repositories in Artifactory, but I thought that PyPI might be a more general solution if other departments are in a similar boat.
The text was updated successfully, but these errors were encountered: