Skip to content

Commit

Permalink
run validation for built packages before upload, move to setup.cfg
Browse files Browse the repository at this point in the history
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Oct 10, 2019
1 parent ae51009 commit 708ffb7
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 76 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -14,11 +14,11 @@ branches:

# command to install dependencies
install:
- pip install tox-travis
- pip install tox tox-travis -U --force-reinstall

# command to run tests
script:
- tox
- tox -vv
- docker --version
- make build
- docker images
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
@@ -1,5 +1,6 @@
include LICENSE
include README.md
include pyproject.toml
include powerfulseal/policy/ps-schema.json
include powerfulseal/policy/example-config.yml
include tests/node/example_inventory
Expand Down
4 changes: 2 additions & 2 deletions build/Dockerfile
Expand Up @@ -10,11 +10,11 @@ RUN apt-get update && \

# copy powerfulseal package
WORKDIR /powerfulseal
COPY Makefile LICENSE README.md setup.py MANIFEST.in /powerfulseal/
COPY Makefile LICENSE README.md setup.py setup.cfg MANIFEST.in /powerfulseal/
COPY powerfulseal/ /powerfulseal/powerfulseal/

# install it with pip
RUN python setup.py sdist && pip install ./dist/* && pip list .
RUN pip install . && pip list .


# the actual image we will be pushing up
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
@@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools >= 40.0.4",
"wheel >= 0.29.0",
"setuptools >= 41.0.0",
"wheel >= 0.33.0",
]
build-backend = 'setuptools.build_meta'
62 changes: 62 additions & 0 deletions setup.cfg
@@ -0,0 +1,62 @@
[metadata]
name = powerfulseal
version = 2.7.0
author = Mikolaj Pawlikowski
author_email = mikolaj@pawlikowski.pl
description = PowerfulSeal - a powerful testing tool for Kubernetes clusters
long_description = file: README.md
long_description_content_type = text/markdown
license = Apache 2.0
license_file = LICENSE
url = https://github.com/bloomberg/powerfulseal
project_urls =
Source=https://github.com/bloomberg/powerfulseal
Tracker=https://github.com/bloomberg/powerfulseal/issues
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Developers
Topic :: Software Development :: Test Tools
Programming Language :: Python :: 3

[options]
packages = find:
include_package_data = True
python_requires = >=3
install_requires =
ConfigArgParse>=0.11.0,<1
Flask>=1.0.0,<2
termcolor>=1.1.0,<2
openstacksdk>=0.10.0,<1
spur>=0.3.20,<1
kubernetes>=8.0.1<9
PyYAML>=5.1.2,<6
jsonschema>=3.0.2,<4
boto3>=1.5.15,<2.0.0
azure-common>=1.1.23,<2.0.0
azure-mgmt-resource>=2.2.0,<3.0.0
azure-mgmt-network>=2.7.0,<3.0.0
azure-mgmt-compute>=4.6.2,<5.0.0
future>=0.16.0,<1
requests>=2.21.0,<3
prometheus_client>=0.3.0,<0.4.0
flask-cors>=3.0.6,<4
flask-swagger-ui>=3.18.0<4
coloredlogs>=10.0.0,<11.0.0
six>=1.12.0,<2
paramiko>=2.5.0,<3
google-api-python-client>=1.7.8
google-auth>=1.6.2
google-auth-httplib2>=0.0.3
oauth2client>=4.1.3
datadog>=0.29.0,<1.0.0

[options.extras_require]
testing =
pytest>=3.0,<4
pytest-cov>=2.5,<3
mock>=2,<3

[options.entry_points]
console_scripts =
seal = powerfulseal.cli.__main__:start
powerfulseal = powerfulseal.cli.__main__:start
68 changes: 2 additions & 66 deletions setup.py
@@ -1,67 +1,3 @@
import os
from setuptools import setup, find_packages
from setuptools import setup

def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
name='powerfulseal',
version='2.7.0',
author='Mikolaj Pawlikowski',
author_email='mikolaj@pawlikowski.pl',
url='https://github.com/bloomberg/powerfulseal',
packages=find_packages(),
license=read('LICENSE'),
description='PowerfulSeal - a powerful testing tool for Kubernetes clusters',
long_description=read('README.md'),
long_description_content_type="text/markdown",
install_requires=[
'ConfigArgParse>=0.11.0,<1',
'Flask>=1.0.0,<2',
'termcolor>=1.1.0,<2',
'openstacksdk>=0.10.0,<1',
'spur>=0.3.20,<1',
'kubernetes>=8.0.1<9',
'PyYAML>=5.1.2,<6',
'jsonschema>=3.0.2,<4',
'boto3>=1.5.15,<2.0.0',
'azure-common>=1.1.23,<2.0.0',
'azure-mgmt-resource>=2.2.0,<3.0.0',
'azure-mgmt-network>=2.7.0,<3.0.0',
'azure-mgmt-compute>=4.6.2,<5.0.0',
'future>=0.16.0,<1',
'requests>=2.21.0,<3',
'prometheus_client>=0.3.0,<0.4.0',
'flask-cors>=3.0.6,<4',
'flask-swagger-ui>=3.18.0<4',
'coloredlogs>=10.0.0,<11.0.0',
'six>=1.12.0,<2',
'paramiko>=2.5.0,<3',
'google-api-python-client>=1.7.8',
'google-auth>=1.6.2',
'google-auth-httplib2>=0.0.3',
'oauth2client>=4.1.3',
'datadog>=0.29.0,<1.0.0'
],
extras_require={
'testing': [
'pytest>=3.0,<4',
'pytest-cov>=2.5,<3',
'mock>=2,<3',
]
},
entry_points={
'console_scripts': [
'seal = powerfulseal.cli.__main__:start',
'powerfulseal = powerfulseal.cli.__main__:start',
]
},
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Test Tools',
'Programming Language :: Python :: 3',
],
python_requires='>=3',
include_package_data=True,
)
setup()
24 changes: 20 additions & 4 deletions tox.ini
@@ -1,5 +1,10 @@
[tox]
envlist = py36,py37
envlist =
py36
py37
pkg_desc
isolated_build = true
skip_missing_interpreters = true

[testenv]
; Install pbr (a dependency of os-service-types) in advance to skip os-service-types
Expand All @@ -8,14 +13,25 @@ envlist = py36,py37
deps = pbr
extras = testing
commands = python -m pytest --ignore=./powerfulseal/web/ui
description = run test suite under {basepython}

[testenv:pypi_publish]
[testenv:pkg_desc]
changedir = {toxinidir}
description = Upload a new package to PyPI
description = check that the long description is valid
basepython = python3.7
deps = twine >= 1.12.1
readme-renderer[md] >= 24.0
pep517
passenv = TWINE_PASSWORD
skip_install = true
commands = python -m pep517.build -s -b . -o {envtmpdir}
twine check {envtmpdir}/*

[testenv:pypi_publish]
changedir = {toxinidir}
description = Upload a new package to PyPI
basepython = {[testenv:pkg_desc]basepython}
deps = {[testenv:pkg_desc]deps}
skip_install = {[testenv:pkg_desc]skip_install}
passenv = TWINE_PASSWORD
commands = {[testenv:pkg_desc]commands}
twine upload --verbose -u __token__ {envtmpdir}/*

0 comments on commit 708ffb7

Please sign in to comment.