Skip to content

Commit

Permalink
Switched to setuptools vs pbr
Browse files Browse the repository at this point in the history
  • Loading branch information
retr0h committed Mar 14, 2020
1 parent 54f2a58 commit 5b72c36
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 50 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
*.egg-info/
*.py[cod]
*.py[rcod]
.cache/
.coverage
.eggs/
.tox/
.venv/
build/
coverage.*
dist/
doc/build/
htmlcov/
pip-wheel-metadata/
2 changes: 2 additions & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
3.7.6
3.6.7
14 changes: 2 additions & 12 deletions doc/source/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,12 @@ Tag the release and push to github.com
Upload to `PyPI`_
^^^^^^^^^^^^^^^^^

* Install `Twine`_ using `pip`.

.. code-block:: bash
$ pip install twine
* Upload to `PyPI`_.

.. code-block:: bash
$ cd /path/to/gilt
$ rm -rf build/ dist/
$ python setup.py sdist bdist_wheel
$ twine upload dist/*
$ rm -rf build/ dist/
$ tox -e build-dists
$ tox -e publish-dists
Post-release
------------
Expand All @@ -65,4 +56,3 @@ Roadmap

.. _`PyPI`: https://pypi.python.org/pypi/python-gilt
.. _`ISSUES`: https://github.com/metacloud/gilt/issues
.. _`Twine`: https://pypi.python.org/pypi/twine
8 changes: 5 additions & 3 deletions gilt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

import pbr.version
try:
import pkg_resources

version_info = pbr.version.VersionInfo('python-gilt') # noqa
__version__ = version_info.release_string()
__version__ = pkg_resources.get_distribution('gilt').version
except Exception: # pragma: no cover
__version__ = 'unknown'
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build-system]
requires = [
'setuptools >= 41.0.0',
'setuptools_scm >= 1.15.0',
'setuptools_scm_git_archive >= 1.0',
'wheel',
]
build-backend = 'setuptools.build_meta'
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

59 changes: 44 additions & 15 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
[aliases]
dists = clean --all sdist bdist_wheel

[bdist_wheel]
universal = 1

[metadata]
name = python-gilt
summary = gilt - A GIT layering tool.
description-file = README.rst
author = John Dewey
author-email = [email protected]
home-page = https://github.com/metacloud/gilt
author-email = [email protected]
home-page = https://github.com/retr0h/gilt
classifier =
Development Status :: 4 - Beta
Environment :: Console
Expand All @@ -15,29 +21,52 @@ classifier =
License :: OSI Approved :: MIT License
Natural Language :: English
Operating System :: OS Independent
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: System :: Systems Administration
Topic :: Utilities

[pbr]
skip_authors = True
skip_changelog = True
warnerrors = True
[options]
use_scm_version = True
python_requires = >=3.6
packages = find:
include_package_data = True
zip_safe = False

# These are required during `setup.py` run:
setup_requires =
setuptools_scm >= 1.15.0
setuptools_scm_git_archive >= 1.0

# These are required in actual runtime:
install_requires =
click
colorama
fasteners
git-url-parse
PyYAML
sh

[global]
setup-hooks =
pbr.hooks.setup_hook
[options.extras_require]
# These are required during test:
test =
flake8
hacking
pep517
pytest
pytest-cov
pytest-helpers-namespace
pytest-mock
twine
yapf==0.16.3

[entry_points]
[options.entry_points]
console_scripts =
gilt = gilt.shell:main

[files]
packages =
gilt
[options.packages.find]
where = .

[build_sphinx]
all_files = 1
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@

import setuptools

setuptools.setup(setup_requires=['pbr'], pbr=True)
if __name__ == "__main__":
setuptools.setup(
use_scm_version=True, setup_requires=["setuptools_scm"],
)
6 changes: 0 additions & 6 deletions test-requirements.txt

This file was deleted.

37 changes: 32 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
[tox]
minversion = 1.8
envlist =
py{27,36}-unit
py{27,36}-lint
py{36,37}-unit
py{36,37}-lint
doc

[testenv]
passenv = *
deps =
-rrequirements.txt
-rtest-requirements.txt
commands =
unit: py.test --runslow -vv {posargs}
lint: flake8
extras =
test

[testenv:format]
commands =
Expand All @@ -24,3 +23,31 @@ deps=
-rdoc-requirements.txt
commands=
python setup.py build_sphinx --builder=html

[testenv:build-dists-local]
usedevelop = false
skip_install = true
commands =
python -m pep517.build \
--source \
--binary \
--out-dir {toxinidir}/dist/ \
{toxinidir}

[testenv:build-dists]
commands =
rm -rfv {toxinidir}/dist/
{[testenv:build-dists-local]commands}
whitelist_externals =
rm

[testenv:publish-dists]
commands =
bash -c '\
twine upload {toxinidir}/dist/*.whl \
-u $TWINE_USERNAME \
-p $TWINE_PASSWORD \
--repository-url $TWINE_REPOSITORY \
'
whitelist_externals =
bash

0 comments on commit 5b72c36

Please sign in to comment.