Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. ### Disclaimer
  2.  
  3. _TL;DR: please don't spend your voluteer time helping me solve problems I'll get paid for, if you don't want
  4. the answer too._
  5.  
  6. While I'm interested in solving these questions for open source packages, the open source package I
  7. personally maintain don't have this much traction that I can't do it by myself. I'm also
  8. interested in this to solve problems I have at work, and it's disloyal to crowdsource ideas for
  9. problems I have in closed-source projects without explicitely stating so. So here I am, stating
  10. that whatever comes out of this may benefit my closed source projects maybe more
  11. than my open source ones. But maybe yours too.
  12.  
  13. ### The goals
  14.  
  15. - On some projects I'd like to have automatic releases after every PR merge (hypothesis style)
  16. - On some projects, I'd like to trigger a release (either from a PR or out of the blue)
  17.  
  18. ### The constraints: release should:
  19.  
  20. 1. Be incremental, minor or major. There should be a way to specify (ideally releated to the associated PR)
  21. 2. Have a git tag
  22. 3. Be published in PyPI
  23. 4. Have a changelog accessible somewhere (albeit no necessarily in the code. Readthedocs is ok)
  24. 5. Have a changelog containing release dates, which may not be the PR merge date
  25. 6. Have a changelog created from fragments (towncrier style) to avoid constant conflicts
  26. 7. Be a 1-step operation. I'd rather not the release process would create a PR, and this PR merge would trigger the release.
  27.  
  28. Other constraints:
  29.  
  30. 8. The code should able to introspect its own current version (`from mypackage import __version__`),
  31. even when installed from the source in `-e`
  32. 9. The process should be able to run in a repository that protects master branch from commits without PR
  33.  
  34. 10. And as much as possible, this should be usable in different packages, and simple to setup.
  35.  
  36. All constraints are debatable.
  37.  
  38. ### The problems & leads
  39.  
  40. TL;DR: I'd like a release not to necessitate a change in the code. When I release today, I have 2 changes:
  41. Towncrier changelog compilation and update of the version number in setup.cfg. How to solve both ?
  42.  
  43. Towncrier (or other fragment based changelog tool) need a "changelog compilation". This modifies the files.
  44. This means at realase time, there's a code change, so there's a commit, so there's a PR and it invalidates point 7.
  45.  
  46. We could run towncrier in the docs job only, and all the fragments and reconstruct the whole changelog from scratch
  47. everytime but we'd need a different fragment folder for each release, and to store the release date somewhere.
  48.  
  49. We could remove the fragment-based contraint, but we'd still have to figure out the release date and put that somewhere.
  50.  
  51. Then there's the problem of the current version number. Should it be written in `setup.cfg` ? if not and `setup.cfg` holds
  52. a placeholder that's only filled at release time and not committed, how to satisfy 8.
  53.  
  54. We could dynamically call `git describe` in this case to get the value for `__version__`.
  55.  
  56. ### What I see elsewhere
  57.  
  58. - Hypothesis: each contributors adds a `RELEASE.rst` file in their PR, stating patch/minor/major and the changelog.
  59. The CI releases based on this, builds the changelog, commits the removal of RELEASE.rst and pushes on master. This clashes
  60. with 9.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement