Skip to content

Commit

Permalink
release 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewyates committed Jun 13, 2020
1 parent 2b0b732 commit 5d79fc1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
2 changes: 2 additions & 0 deletions capreolus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from profane import ConfigOption, Dependency, constants, config_list_to_dict

__version__ = "0.2.1"

# specify a base package that we should look for modules under (e.g., <BASE>.task)
# constants must be specified before importing Task (or any other modules!)
constants["BASE_PACKAGE"] = "capreolus"
Expand Down
29 changes: 24 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,36 @@
sys.path.insert(0, os.path.abspath("../"))
assert os.path.exists(os.path.abspath("../capreolus"))

# from https://packaging.python.org/guides/single-sourcing-package-version/
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, rel_path), "rt") as fp:
return fp.read()


def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")


# -- Project information -----------------------------------------------------

project = "Capreolus"
copyright = "2020"
author = ""
author = "Andrew Yates"

# The short X.Y version
version = "0.2"
# The full version, including alpha/beta/rc tags
release = "0.2.0"

release = get_version("../capreolus/__init__.py")
# The short X.Y version
version = release
# no need to separate these currently
# version = ".".join(release.split(".")[:2])
# assert version.count(".") == 1
assert release.startswith(version)

# -- General configuration ---------------------------------------------------

Expand Down
18 changes: 17 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,25 @@ def run(self):
with open("README.md", "r") as fh:
long_description = fh.read()

# from https://packaging.python.org/guides/single-sourcing-package-version/
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, rel_path), "rt") as fp:
return fp.read()


def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")


setuptools.setup(
name="capreolus",
version="0.2.0",
version=get_version("capreolus/__init__.py"),
author="Andrew Yates, Kevin Martin Jose, Xinyu Zhang, Siddhant Arora, Wei Yang, Jimmy Lin",
author_email="",
description="A toolkit for end-to-end neural ad hoc retrieval",
Expand Down

0 comments on commit 5d79fc1

Please sign in to comment.