-
Notifications
You must be signed in to change notification settings - Fork 572
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
Better releases #593
Merged
Merged
Better releases #593
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
08b0d79
Improve CONTRIBUTING.md and surface nbconvert[all]
mpacer 82f87ea
add release instructions ala notebook
mpacer f1a8e8f
add better version number checking
mpacer 6503dd4
add pep440 to setup.py requirements
mpacer 696b08c
take into account the nonneed to pass in an integer at dev_seg
mpacer 044cc7f
Ok, just grab all the things from pep440
mpacer c43eff3
move _version_tools into their own place and leave _version somewhat …
mpacer b3193e4
move functions back into _version.py, explicitly cite pep440's GitHub
mpacer a762528
improve docs per suggestions
mpacer ab3715e
ok apparently it needs to be entirely within the function to work. I'…
mpacer 601174c
add nicer way of specifying extra_requirements
mpacer 45f44ce
remove unnecessary extras_require
mpacer 911065c
used appendix B from pep440
mpacer fa4959a
fix backtick in link
mpacer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _changelog: | ||
|
||
Changes in nbconvert | ||
==================== | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
.. _nbconvert_release: | ||
|
||
Making an ``nbconvert`` release | ||
=============================== | ||
|
||
This document guides a contributor through creating a release of ``nbconvert``. | ||
|
||
|
||
Assign all merged PRs to milestones | ||
----------------------------------- | ||
|
||
Go to GitHub and assign all PRs that have been merged to milestones. This will | ||
be helpful when you update the changelog. If you go to this `GitHub page <Github | ||
no milestones_>`_ you will find all the PRs that currently have no milestones. | ||
|
||
.. _GitHub no milestones: https://github.com/jupyter/nbconvert/pulls?utf8=%E2%9C%93&q=is%3Amerged%20is%3Apr%20no%3Amilestone%20 | ||
|
||
Check installed tools | ||
--------------------- | ||
|
||
Review ``CONTRIBUTING.md``, particularly the testing and release sections. | ||
|
||
Clean the repository | ||
-------------------- | ||
|
||
You can remove all non-tracked files with: | ||
|
||
.. code:: bash | ||
|
||
git clean -xfdi | ||
|
||
This would ask you for confirmation before removing all untracked files. | ||
|
||
Make sure the ``dist/`` folder is clean and avoid stale builds from | ||
previous attempts. | ||
|
||
Create the release | ||
------------------ | ||
|
||
#. Update the :doc:`changelog <changelog>` to account for all the PRs assigned to this milestone. | ||
|
||
#. Update version number in ``notebook/_version.py``. | ||
|
||
#. Commit and tag the release with the current version number: | ||
|
||
.. code:: bash | ||
|
||
git commit -am "release $VERSION" | ||
git tag $VERSION | ||
|
||
#. You are now ready to build the ``sdist`` and ``wheel``: | ||
|
||
.. code:: bash | ||
|
||
python setup.py sdist | ||
python setup.py bdist_wheel | ||
|
||
#. You can now test the ``wheel`` and the ``sdist`` locally before uploading | ||
to PyPI. Make sure to use `twine <https://github.com/pypa/twine>`_ to | ||
upload the archives over SSL. | ||
|
||
.. code:: bash | ||
|
||
twine upload dist/* | ||
|
||
Release the new version | ||
----------------------- | ||
|
||
Push directly on master, including --tags separately | ||
|
||
.. code:: bash | ||
|
||
git push upstream | ||
git push upstream --tags | ||
|
||
|
||
Return to development state | ||
--------------------------- | ||
|
||
If all went well, change the ``notebook/_version.py`` back adding the | ||
``.dev`` suffix. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,63 @@ | ||
version_info = (5, 2, 0,'.dev') | ||
__version__ = '.'.join(map(str, version_info[0:3])) + ''.join(version_info[3:]) | ||
version_info = (5, 2, 0) | ||
pre_info = '' | ||
dev_info = '.dev' | ||
|
||
def create_valid_version(release_info, epoch=None, pre_input='', dev_input=''): | ||
''' | ||
Creates a pep440 valid version of version number given a tuple integers | ||
and optional epoch, prerelease and developmental info. | ||
|
||
Parameters | ||
---------- | ||
release_info : Tuple(Int) | ||
epoch : Int, default None | ||
pre_input : Str, default '' | ||
dev_input : Str, default '' | ||
''' | ||
|
||
pep440_err = "The version number is not a pep 440 compliant version number" | ||
|
||
|
||
if epoch is not None: | ||
epoch_seg = str(epoch) + '!' | ||
else: | ||
epoch_seg = '' | ||
|
||
release_seg = '.'.join(map(str, release_info)) | ||
|
||
_magic_pre = ['a','b','rc'] | ||
if pre_input!='' and not any([pre_input.startswith(prefix) for prefix in _magic_pre]): | ||
raise ValueError(pep440_err + "\n please fix your prerelease segment.") | ||
else: | ||
pre_seg = pre_input | ||
|
||
if dev_input=='': | ||
dev_seg = dev_input | ||
elif not dev_input.startswith('.') and dev_input.startswith('dev'): | ||
dev_seg = ''.join(['.', dev_input]) | ||
elif dev_input.startswith('.dev'): | ||
dev_seg = dev_input | ||
elif dev_input!='': | ||
raise ValueError(pep440_err + "\n please fix your development segment.") | ||
|
||
if dev_input!='' and not any([dev_seg.endswith(str(n)) for n in range(10)]): | ||
dev_seg = ''.join([dev_seg,'0']) | ||
|
||
out_version = ''.join([epoch_seg, release_seg, pre_seg, dev_seg]) | ||
|
||
|
||
import re | ||
def is_canonical(version): | ||
return re.match(r'^([1-9]\d*!)?(0|[1-9]\d*)' | ||
r'(\.(0|[1-9]\d*))*((a|b|rc)(0|[1-9]\d*))?' | ||
r'(\.post(0|[1-9]\d*))?(\.dev(0|[1-9]\d*))?$', | ||
version | ||
) is not None | ||
|
||
if is_canonical(out_version): | ||
return out_version | ||
else: | ||
raise ValueError(pep440_err) | ||
|
||
|
||
__version__ = create_valid_version(version_info, pre_input=pre_info, dev_input=dev_info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked a built copy of this? I can't remember if backticks in headings work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they do work.