Skip to content

Commit

Permalink
Add packaging information and versions
Browse files Browse the repository at this point in the history
To make it easier to deploy the package, the travis script has been
extended and additional package information has been added.
  • Loading branch information
SwamyDev committed Oct 6, 2019
1 parent 782d64f commit c35f6ac
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ script:
- make coverage
after_success:
- coveralls
deploy:
provider: pypi
user: SwamyDev
password:
secure: Xv+8rvF1JMrl3SfKTacqWp0dAmAF47OF0ulphZUETkVffoZDgJ5hvSwEl9k+M+7C2OhTQR+RKFWYKdOa+oS726gBxrHu8ZTPprZ/ENwEyE6XMMTP0DqVOoXy/MeG+21pqktNnJ5aRMbHgFY9bdaTC3I608dpUozcNBDyf8SB3FoASeWUZtK0ikiHGQLCM7hF1cN5Jn9WRGtCEbtvFtoOSdCsUmShEr7QTWkH7mgwO8iAlsEwXsQbmg+l/uP8wNQoChjsDKAqL9JQ/Y58mg6GRUNeSHu1IGUXxzPUNVqTWF9jSTPn6pPF1lYeK4vymBZ8F2T1oo4EN6CV8thlvzYJwgcD3BU7eLWMhofKQ60pohivsVgq6N80DFDebU3XbDy4d2heSWmidwYVnOha0WyE1SZzLrfBtfmb+n2+ktSlMvKEJpRiv5gLuT4p1ShikLS2XG9Jx5Tdfaz/wXDAbNG3WHZu3g8iQEyBVCUCL3eJsD9qSasTjnhrVgANw9UX+TVD0DalVByi3TIP5jjOpH6cL5ayVRed2ot8HOK4gh1Zg/NMK7ycbWvskXJe3wiPQJFKpwzsrhwfcKKgqP4jK/W8HXb2VQdvBpjAxhcnY5UgEU6RM6OPm9HDVl7+K1jZrEkVT+aI6bE1r8Ocxl2+2CJsnRjD4V3xi60Rw8K7zBxkuA0=
on:
tags: true
distributions: "sdist bdist_wheel"
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help clean install test coverage
.PHONY: help meta install clean test coverage

TARGET ?=
ifdef TARGET
Expand All @@ -9,6 +9,8 @@ endif

.DEFAULT: help
help:
@echo "make meta"
@echo " update version number and meta data"
@echo "make install"
@echo " install gym-quickcheck and dependencies in currently active environment"
@echo "make clean"
Expand All @@ -18,6 +20,9 @@ help:
@echo "make coverage"
@echo " run all tests and produce coverage report"

meta:
python meta.py `git describe --tags --abbrev=0`

clean:
find . -name '*.pyc' -exec rm --force {} +
find . -name '*.pyo' -exec rm --force {} +
Expand Down
3 changes: 3 additions & 0 deletions gym_quickcheck/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from gym.envs.registration import register

from gym_quickcheck._version import __version__

name = "gym_quickcheck"

register(
id='random-walk-v0',
Expand Down
1 change: 1 addition & 0 deletions gym_quickcheck/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.0.0'
17 changes: 17 additions & 0 deletions meta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import re
import sys


def parse_version(git_version):
m = re.search('v(.+)', git_version)
return m.group(1)


def update_version(git_version):
v = parse_version(git_version)
with open('gym_quickcheck/_version.py', 'w') as f:
f.write(f"__version__ = '{v}'\n")


if __name__ == "__main__":
update_version(sys.argv[1])
45 changes: 42 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
import subprocess
import sys
from pathlib import Path

from setuptools import setup, find_packages

setup(name='gym_quickcheck',
version='0.0.0',
here = Path(__file__).absolute().parent

error = subprocess.call(['make', 'meta'])
if error:
print(f"failed to run 'make meta' with error: {error}")
sys.exit(-1)

with open(here / Path('README.md'), encoding='utf-8') as f:
long_description = f.read().replace('\r\n', '\n')

_version = {}
with open(here / Path('gym_quickcheck/_version.py', mode='r')) as f:
exec(f.read(), _version)

setup(
name='gym_quickcheck',
version=_version['__version__'],
description='Gym environments that allow for coarse but fast testing of AI agents.',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/SwamyDev/gym-quickcheck',
author='Bernhard Raml',
author_email='pypi-reinforcment@googlegroups.com',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development :: Testing'
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
],
packages=find_packages(include='gym_quickcheck'),
install_requires=['gym'],
extras_require={'test': ['pytest']})
extras_require={'test': ['pytest']},
keywords='OpeanAI gym testing continuous integration',
project_urls={
'Bug Reports': 'https://github.com/SwamyDev/gym-quickcheck/issues',
'Source': 'https://github.com/SwamyDev/gym-quickcheck',
},
)

0 comments on commit c35f6ac

Please sign in to comment.