Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add farm.__version__ tag #761

Merged
merged 1 commit into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions farm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging

import torch.multiprocessing as mp
from farm._version import __version__

logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
Expand Down
1 change: 1 addition & 0 deletions farm/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.7.2+snapshot"
20 changes: 19 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python
import os
import re
from io import open

from setuptools import find_packages, setup
Expand Down Expand Up @@ -44,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__))


setup(
name="farm",
version="0.7.1",
version=versionfromfile(here, "farm", "_version.py"),
author="Timo Moeller, Malte Pietsch, Branden Chan, Tanay Soni, Bogdan Kostic, Julian Risch",
author_email="[email protected]",
description="Framework for finetuning and evaluating transformer based language models",
Expand Down