Skip to content

Commit

Permalink
Set up cs-ranking for release on PyPi (#84)
Browse files Browse the repository at this point in the history
* Set up cs-ranking for proper versioning

The following changes are implemented:

* Usage of bump2version to semi-automated changing of version strings
* Add token for PyPi to .travis.yml
* Create HISTORY.rst file to track changes
* Bump version: 1.0.0 → 1.0.1
  • Loading branch information
kiudee committed Feb 11, 2020
1 parent 4027a22 commit 5e8115d
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 15 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Expand Up @@ -30,3 +30,14 @@ script:
after_success:
- coveralls
- travis-sphinx deploy

deploy:
provider: pypi
distributions: sdist bdist_wheel
user: __token__
password:
secure: INa6/h17ejVh3vxAGc4V7uLY30tJON2n/PWV3y0x0DnAR+pH5LiR3ZIE8/CNu1NpH+R7I1u2m0PHLYh5H8XpuewHaToer4p41jIiGF6WXnUg6PQN7zuBk9tqgmJElr+aYp/oK/B6VHTfFwEk2QlXmcqVofpKQNWrzm6+EMWXJjSs3Z9XyGIJvzJ2ihaHvr4URlNfjX98Ij0uIzzEBzN7RSJISQQo672F0b+JvgR3nQYfa5Sp4ijBnEuTtU2BYiXcojaT283O49DL0LGQHApIu0Blf79FXA2QJET65ujIQDxKBZ+WhPEHupwIiBsJ1JLl5C0wBj0UAXyogypXhm9tXfOwB12MLsbT8pbH7YMY4vS8lKtXltWTw66JbruNxECCcvHMw6SnCX0D1H40LKCvQLLJ4L2IOkVcpLI702Tlf13OF4kic+OGfSBv0nRDTLzyvMU5NACoMLnBipbpN4qXKeJdoHWOKECiRYFqZLacxPSGXx/RteiEpi25Ghgk2x53Y6pNCpzW118qW/Ij2LvPffB9PT/BPe0MIjveDLJ3PI93xevDljyZHE8v7JGOPo4gX3YA4hYwMB6gZtO+bdIemGQIP5ymrIpKqSDw/CpFLUCUVzL8sOu5AE3pbDFUGdn5njSex7Leafs+px7IH6dLE2MQqCU1o9Qr4V4FTuxta60=
on:
tags: true
repo: kiudee/cs-ranking
python: 3.8
14 changes: 14 additions & 0 deletions HISTORY.rst
@@ -0,0 +1,14 @@
=======
History
=======

1.0.1 (2020-02-03)
------------------

* Add ``HISTORY.rst`` file to track changes over time
* Set up travis-ci for deployment to PyPi

1.0.0 (2018-03-05)
------------------

* Initial release
2 changes: 2 additions & 0 deletions csrank/__init__.py
@@ -1,3 +1,5 @@
__version__ = "1.0.1"

from .choicefunction import *
from .core import *
from .dataset_reader import *
Expand Down
1 change: 1 addition & 0 deletions docs/history.rst
@@ -0,0 +1 @@
.. include:: ../HISTORY.rst
1 change: 1 addition & 0 deletions docs/index.rst
Expand Up @@ -7,6 +7,7 @@ Welcome to CSRank's documentation!
intro
examples
api
history


Indices and tables
Expand Down
16 changes: 16 additions & 0 deletions setup.cfg
@@ -0,0 +1,16 @@
[bumpversion]
current_version = 1.0.1
commit = True
tag = True

[bumpversion:file:setup.py]
search = version="{current_version}"
replace = version="{new_version}"

[bumpversion:file:csrank/__init__.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

[bdist_wheel]
universal = 1

38 changes: 23 additions & 15 deletions setup.py
Expand Up @@ -2,25 +2,33 @@

from setuptools import setup, find_packages

DISTNAME = 'csrank'
DESCRIPTION = 'Context-sensitive ranking'
MAINTAINER = 'Karlson Pfannschmidt'
MAINTAINER_EMAIL = 'kiudee@mail.upb.de'
VERSION = "1.0"
with open("README.rst") as readme_file:
readme = readme_file.read()

with open("HISTORY.rst") as history_file:
history = history_file.read()

DISTNAME = "csrank"
DESCRIPTION = "Context-sensitive ranking"
MAINTAINER = "Karlson Pfannschmidt"
MAINTAINER_EMAIL = "kiudee@mail.upb.de"

PROJECT_ROOT = dirname(realpath(__file__))
REQUIREMENTS_FILE = join(PROJECT_ROOT, 'requirements.txt')
REQUIREMENTS_FILE = join(PROJECT_ROOT, "requirements.txt")

with open(REQUIREMENTS_FILE) as f:
install_reqs = f.read().splitlines()

if __name__ == "__main__":
setup(name=DISTNAME,
version=VERSION,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
packages=find_packages(),
install_requires=install_reqs,
package_data={'notebooks': ['*']},
include_package_data=True)
setup(
name=DISTNAME,
version="1.0.1",
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
packages=find_packages(),
install_requires=install_reqs,
package_data={"notebooks": ["*"]},
include_package_data=True,
long_description=readme + "\n\n" + history
)

0 comments on commit 5e8115d

Please sign in to comment.