[setup] version tag added to Haystack fix #1175 (#1216)

This commit is contained in:
Ikram Ali 2021-06-22 12:43:26 +05:00 committed by GitHub
parent 66049abff0
commit d835a9cdc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import pandas as pd
from haystack.schema import Document, Label, MultiLabel, BaseComponent
from haystack.finder import Finder
from haystack.pipeline import Pipeline
from haystack._version import __version__
pd.options.display.max_colwidth = 80

1
haystack/_version.py Normal file
View File

@ -0,0 +1 @@
__version__ = "0.9.0"

View File

@ -1,3 +1,5 @@
import os
import re
from io import open
from setuptools import find_packages, setup
@ -45,9 +47,24 @@ def get_dependency_links(filename):
dependency_links = get_dependency_links('requirements.txt')
parsed_requirements = parse_requirements('requirements.txt')
def versionfromfile(*filepath):
infile = os.path.join(*filepath)
with open(infile) as fp:
version_match = re.search(
r"^__version__\s*=\s*['\"]([^'\"]*)['\"]", fp.read(), re.M
)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string in {}.".format(infile))
here = os.path.abspath(os.path.dirname(__file__))
_version: str = versionfromfile(here, "haystack", "_version.py")
setup(
name="farm-haystack",
version="0.9.0",
version=_version,
author="Malte Pietsch, Timo Moeller, Branden Chan, Tanay Soni",
author_email="malte.pietsch@deepset.ai",
description="Neural Question Answering & Semantic Search at Scale. Use modern transformer based models like BERT to find answers in large document collections",
@ -56,7 +73,7 @@ setup(
keywords="QA Question-Answering Reader Retriever semantic-search search BERT roberta albert squad mrc transfer-learning language-model transformer",
license="Apache",
url="https://github.com/deepset-ai/haystack",
download_url="https://github.com/deepset-ai/haystack/archive/0.9.0.tar.gz",
download_url=f"https://github.com/deepset-ai/haystack/archive/{_version}.tar.gz",
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
dependency_links=dependency_links,
install_requires=parsed_requirements,