Merge pull request #1834 from RonnyPfannschmidt/setuptools-scm-take-2
second take at setuptools_scm
This commit is contained in:
commit
cccb2cc92b
|
@ -18,6 +18,9 @@ include/
|
||||||
*~
|
*~
|
||||||
.hypothesis/
|
.hypothesis/
|
||||||
|
|
||||||
|
# autogenerated
|
||||||
|
_pytest/_version.py
|
||||||
|
# setuptools
|
||||||
.eggs/
|
.eggs/
|
||||||
|
|
||||||
doc/*/_build
|
doc/*/_build
|
||||||
|
|
|
@ -3,27 +3,25 @@ How to release pytest
|
||||||
|
|
||||||
Note: this assumes you have already registered on pypi.
|
Note: this assumes you have already registered on pypi.
|
||||||
|
|
||||||
1. Bump version numbers in ``_pytest/__init__.py`` (``setup.py`` reads it).
|
#. Check and finalize ``CHANGELOG.rst``.
|
||||||
|
|
||||||
2. Check and finalize ``CHANGELOG.rst``.
|
#. Write ``doc/en/announce/release-VERSION.txt`` and include
|
||||||
|
|
||||||
3. Write ``doc/en/announce/release-VERSION.txt`` and include
|
|
||||||
it in ``doc/en/announce/index.txt``. Run this command to list names of authors involved::
|
it in ``doc/en/announce/index.txt``. Run this command to list names of authors involved::
|
||||||
|
|
||||||
git log $(git describe --abbrev=0 --tags)..HEAD --format='%aN' | sort -u
|
git log $(git describe --abbrev=0 --tags)..HEAD --format='%aN' | sort -u
|
||||||
|
|
||||||
4. Regenerate the docs examples using tox::
|
#. Regenerate the docs examples using tox::
|
||||||
|
|
||||||
tox -e regen
|
tox -e regen
|
||||||
|
|
||||||
5. At this point, open a PR named ``release-X`` so others can help find regressions or provide suggestions.
|
#. At this point, open a PR named ``release-X`` so others can help find regressions or provide suggestions.
|
||||||
|
|
||||||
6. Use devpi for uploading a release tarball to a staging area::
|
#. Use devpi for uploading a release tarball to a staging area::
|
||||||
|
|
||||||
devpi use https://devpi.net/USER/dev
|
devpi use https://devpi.net/USER/dev
|
||||||
devpi upload --formats sdist,bdist_wheel
|
devpi upload --formats sdist,bdist_wheel
|
||||||
|
|
||||||
7. Run from multiple machines::
|
#. Run from multiple machines::
|
||||||
|
|
||||||
devpi use https://devpi.net/USER/dev
|
devpi use https://devpi.net/USER/dev
|
||||||
devpi test pytest==VERSION
|
devpi test pytest==VERSION
|
||||||
|
@ -31,27 +29,27 @@ Note: this assumes you have already registered on pypi.
|
||||||
Alternatively, you can use `devpi-cloud-tester <https://github.com/nicoddemus/devpi-cloud-tester>`_ to test
|
Alternatively, you can use `devpi-cloud-tester <https://github.com/nicoddemus/devpi-cloud-tester>`_ to test
|
||||||
the package on AppVeyor and Travis (follow instructions on the ``README``).
|
the package on AppVeyor and Travis (follow instructions on the ``README``).
|
||||||
|
|
||||||
8. Check that tests pass for relevant combinations with::
|
#. Check that tests pass for relevant combinations with::
|
||||||
|
|
||||||
devpi list pytest
|
devpi list pytest
|
||||||
|
|
||||||
or look at failures with "devpi list -f pytest".
|
or look at failures with "devpi list -f pytest".
|
||||||
|
|
||||||
9. Feeling confident? Publish to pypi::
|
#. Feeling confident? Publish to pypi::
|
||||||
|
|
||||||
devpi push pytest==VERSION pypi:NAME
|
devpi push pytest==VERSION pypi:NAME
|
||||||
|
|
||||||
where NAME is the name of pypi.python.org as configured in your ``~/.pypirc``
|
where NAME is the name of pypi.python.org as configured in your ``~/.pypirc``
|
||||||
file `for devpi <http://doc.devpi.net/latest/quickstart-releaseprocess.html?highlight=pypirc#devpi-push-releasing-to-an-external-index>`_.
|
file `for devpi <http://doc.devpi.net/latest/quickstart-releaseprocess.html?highlight=pypirc#devpi-push-releasing-to-an-external-index>`_.
|
||||||
|
|
||||||
10. Tag the release::
|
#. Tag the release::
|
||||||
|
|
||||||
git tag VERSION <hash>
|
git tag VERSION <hash>
|
||||||
git push origin VERSION
|
git push origin VERSION
|
||||||
|
|
||||||
Make sure ``<hash>`` is **exactly** the git hash at the time the package was created.
|
Make sure ``<hash>`` is **exactly** the git hash at the time the package was created.
|
||||||
|
|
||||||
11. Send release announcement to mailing lists:
|
#. Send release announcement to mailing lists:
|
||||||
|
|
||||||
- pytest-dev@python.org
|
- pytest-dev@python.org
|
||||||
- python-announce-list@python.org
|
- python-announce-list@python.org
|
||||||
|
@ -59,7 +57,7 @@ Note: this assumes you have already registered on pypi.
|
||||||
|
|
||||||
And announce the release on Twitter, making sure to add the hashtag ``#pytest``.
|
And announce the release on Twitter, making sure to add the hashtag ``#pytest``.
|
||||||
|
|
||||||
12. **After the release**
|
#. **After the release**
|
||||||
|
|
||||||
a. **patch release (2.8.3)**:
|
a. **patch release (2.8.3)**:
|
||||||
|
|
||||||
|
@ -81,5 +79,3 @@ Note: this assumes you have already registered on pypi.
|
||||||
9. Push ``master`` and ``features``.
|
9. Push ``master`` and ``features``.
|
||||||
|
|
||||||
c. **major release (3.0.0)**: same steps as that of a **minor release**
|
c. **major release (3.0.0)**: same steps as that of a **minor release**
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,8 @@
|
||||||
#
|
__all__ = ['__version__']
|
||||||
__version__ = '3.1.0.dev0'
|
|
||||||
|
try:
|
||||||
|
from ._version import version as __version__
|
||||||
|
except ImportError:
|
||||||
|
# broken installation, we don't even try
|
||||||
|
# unknown only works because we do poor mans version compare
|
||||||
|
__version__ = 'unknown'
|
||||||
|
|
|
@ -18,4 +18,3 @@ if os.path.isdir('.git'):
|
||||||
else:
|
else:
|
||||||
print('No .git directory found, skipping checking the manifest file')
|
print('No .git directory found, skipping checking the manifest file')
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,10 @@ upload-dir = doc/en/build/html
|
||||||
[bdist_wheel]
|
[bdist_wheel]
|
||||||
universal = 1
|
universal = 1
|
||||||
|
|
||||||
|
[check-manifest]
|
||||||
|
ignore =
|
||||||
|
_pytest/_version.py
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
license_file = LICENSE
|
license_file = LICENSE
|
||||||
|
|
||||||
|
|
42
setup.py
42
setup.py
|
@ -1,32 +1,27 @@
|
||||||
import os, sys
|
import os
|
||||||
|
import sys
|
||||||
import setuptools
|
import setuptools
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
from setuptools import setup, Command
|
from setuptools import setup, Command
|
||||||
|
|
||||||
classifiers = ['Development Status :: 6 - Mature',
|
classifiers = [
|
||||||
'Intended Audience :: Developers',
|
'Development Status :: 6 - Mature',
|
||||||
'License :: OSI Approved :: MIT License',
|
'Intended Audience :: Developers',
|
||||||
'Operating System :: POSIX',
|
'License :: OSI Approved :: MIT License',
|
||||||
'Operating System :: Microsoft :: Windows',
|
'Operating System :: POSIX',
|
||||||
'Operating System :: MacOS :: MacOS X',
|
'Operating System :: Microsoft :: Windows',
|
||||||
'Topic :: Software Development :: Testing',
|
'Operating System :: MacOS :: MacOS X',
|
||||||
'Topic :: Software Development :: Libraries',
|
'Topic :: Software Development :: Testing',
|
||||||
'Topic :: Utilities'] + [
|
'Topic :: Software Development :: Libraries',
|
||||||
('Programming Language :: Python :: %s' % x) for x in
|
'Topic :: Utilities',
|
||||||
'2 2.6 2.7 3 3.3 3.4 3.5 3.6'.split()]
|
] + [
|
||||||
|
('Programming Language :: Python :: %s' % x)
|
||||||
|
for x in '2 2.6 2.7 3 3.3 3.4 3.5 3.6'.split()
|
||||||
|
]
|
||||||
|
|
||||||
with open('README.rst') as fd:
|
with open('README.rst') as fd:
|
||||||
long_description = fd.read()
|
long_description = fd.read()
|
||||||
|
|
||||||
def get_version():
|
|
||||||
p = os.path.join(os.path.dirname(
|
|
||||||
os.path.abspath(__file__)), "_pytest", "__init__.py")
|
|
||||||
with open(p) as f:
|
|
||||||
for line in f.readlines():
|
|
||||||
if "__version__" in line:
|
|
||||||
return line.strip().split("=")[-1].strip(" '")
|
|
||||||
raise ValueError("could not read version")
|
|
||||||
|
|
||||||
|
|
||||||
def has_environment_marker_support():
|
def has_environment_marker_support():
|
||||||
"""
|
"""
|
||||||
|
@ -63,7 +58,9 @@ def main():
|
||||||
name='pytest',
|
name='pytest',
|
||||||
description='pytest: simple powerful testing with Python',
|
description='pytest: simple powerful testing with Python',
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
version=get_version(),
|
use_scm_version={
|
||||||
|
'write_to': '_pytest/_version.py',
|
||||||
|
},
|
||||||
url='http://pytest.org',
|
url='http://pytest.org',
|
||||||
license='MIT license',
|
license='MIT license',
|
||||||
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
|
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
|
||||||
|
@ -74,6 +71,7 @@ def main():
|
||||||
keywords="test unittest",
|
keywords="test unittest",
|
||||||
cmdclass={'test': PyTest},
|
cmdclass={'test': PyTest},
|
||||||
# the following should be enabled for release
|
# the following should be enabled for release
|
||||||
|
setup_requires=['setuptools-scm'],
|
||||||
install_requires=install_requires,
|
install_requires=install_requires,
|
||||||
extras_require=extras_require,
|
extras_require=extras_require,
|
||||||
packages=['_pytest', '_pytest.assertion', '_pytest._code', '_pytest.vendored_packages'],
|
packages=['_pytest', '_pytest.assertion', '_pytest._code', '_pytest.vendored_packages'],
|
||||||
|
|
5
tox.ini
5
tox.ini
|
@ -47,6 +47,9 @@ commands=
|
||||||
|
|
||||||
[testenv:linting]
|
[testenv:linting]
|
||||||
basepython = python2.7
|
basepython = python2.7
|
||||||
|
# needed to keep check-manifest working
|
||||||
|
setenv =
|
||||||
|
SETUPTOOLS_SCM_PRETEND_VERSION=2.0.1
|
||||||
deps =
|
deps =
|
||||||
flake8
|
flake8
|
||||||
# pygments required by rst-lint
|
# pygments required by rst-lint
|
||||||
|
@ -56,7 +59,7 @@ deps =
|
||||||
commands =
|
commands =
|
||||||
{envpython} scripts/check-manifest.py
|
{envpython} scripts/check-manifest.py
|
||||||
flake8 pytest.py _pytest testing
|
flake8 pytest.py _pytest testing
|
||||||
rst-lint CHANGELOG.rst HOWTORELEASE.rst README.rst
|
rst-lint CHANGELOG.rst HOWTORELEASE.rst README.rst --encoding utf-8
|
||||||
|
|
||||||
[testenv:py27-xdist]
|
[testenv:py27-xdist]
|
||||||
deps=pytest-xdist>=1.13
|
deps=pytest-xdist>=1.13
|
||||||
|
|
Loading…
Reference in New Issue