zestsoftware / zest.releaser

Python software releasing made easy and repeatable
https://zestreleaser.readthedocs.io
GNU General Public License v2.0
198 stars 62 forks source link

Running buildout command before uploading #261

Closed hvelarde closed 6 years ago

hvelarde commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

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

reinout commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 4 years ago

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 :+1: )