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

Running buildout command before uploading #261

Closed
hvelarde opened this issue Feb 8, 2018 · 6 comments
Closed

Running buildout command before uploading #261

hvelarde opened this issue Feb 8, 2018 · 6 comments

Comments

@hvelarde
Copy link

hvelarde commented Feb 8, 2018

I have the following issue: lately we started using webpack to generate static resources in some of our packages. AFAIK, when I try to make a release zest.releaser clones the package and does a check out of the tag; that means generated files are not there and are not being included in the released wheel or zip file.

may I ask why we are making this new clone now? is there a way to use current directory instead? is there a way to run the whole buildout to generate those files?

the package I'm trying to release is brasil.gov.temas and we use sc.recipe.staticresources to generate the static resources.

@reinout
Copy link
Collaborator

reinout commented Feb 8, 2018

The reason is to guarantee a nice clean release. Too often, files are included by accident that should not have been there. Or files aren't checked in but are included in the release.

Making a clone has been in zest.releaser since day one, I think. It will have been "svn export" at that time, but ok :-)

Currently I'd say the quickest way is to let zest.releaser checkout the tag, but to not let it upload to pypi. You can then run buildout by hand and upload the package.

Alternatively you could write a small extension to zest.releaser (a zest.releaser.releaser.middle entry point, I guess). See http://zestreleaser.readthedocs.io/en/latest/entrypoints.html
This extension could copy over the static files.

@hvelarde
Copy link
Author

hvelarde commented Feb 8, 2018

let me see if I understood correctly, just to leave it documented here:

  • run prerelease
  • run python setup.py sdist and twine upload
  • run postrelease

do I miss something else? do I have to checkout to the tag in the middle?

@reinout
Copy link
Collaborator

reinout commented Feb 8, 2018

What I meant was "just do fullrelease, but don't let it upload to pypi, you can then afterwards run buildout and do the release then".

But.... doing the "release" step by hand is also fine. It has the advantage that you can do it in a short script!

What you're missing is git tag ... and git push --tags. You should get the correct version (to use use for the tag) from python setup.py --version.

@reinout
Copy link
Collaborator

reinout commented Feb 8, 2018

Note that it might be doable to change zest.releaser to not checkout into a separate directory, but to stay in the current one. The need just never arose for that functionality.

@hvelarde
Copy link
Author

hvelarde commented Feb 8, 2018

thanks! I'll try to figure out the right way to make the release next time because I'm currently using the outdated python setup.py register -r pypi sdist --formats=zip upload -r pypi.

@gforcada
Copy link
Contributor

Late on the party, but for this specific purpose I wrote yarn.build which might not be generic enough, but can be made so :) (PR welcome 👍 )

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

No branches or pull requests

3 participants