forked from facebookresearch/xformers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include git hash and install date in version
ghstack-source-id: 4fb6bf321356e40c8066351c7a28c55675d3a27a Pull Request resolved: facebookresearch#511
- Loading branch information
danthe3rd
committed
Nov 10, 2022
1 parent
3cae847
commit 86e3db2
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
# This source code is licensed under the BSD license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
import datetime | ||
import distutils.command.clean | ||
import glob | ||
import os | ||
|
@@ -33,12 +34,22 @@ def fetch_requirements(): | |
return reqs | ||
|
||
|
||
def get_local_version_suffix() -> str: | ||
date_suffix = datetime.datetime.now().strftime("%Y%m%d") | ||
git_hash = subprocess.check_output( | ||
["git", "rev-parse", "--short", "HEAD"], cwd=Path(__file__).parent | ||
).decode("ascii")[:-1] | ||
return f"+{git_hash}.d{date_suffix}" | ||
|
||
|
||
if os.getenv("BUILD_VERSION"): | ||
# In CI | ||
version = os.getenv("BUILD_VERSION") | ||
else: | ||
version_txt = os.path.join(this_dir, "version.txt") | ||
with open(version_txt) as f: | ||
version = f.readline().strip() | ||
version += get_local_version_suffix() | ||
|
||
|
||
def write_version_file(): | ||
|
@@ -256,7 +267,6 @@ def run(self): | |
name="xformers", | ||
description="XFormers: A collection of composable Transformer building blocks.", | ||
version=version, | ||
setup_requires=[], | ||
install_requires=fetch_requirements(), | ||
packages=setuptools.find_packages(exclude=("tests", "tests.*")), | ||
ext_modules=get_extensions(), | ||
|
@@ -267,7 +277,7 @@ def run(self): | |
url="https://facebookresearch.github.io/xformers/", | ||
python_requires=">=3.6", | ||
author="Facebook AI Research", | ||
author_email="lefaudeux@fb.com", | ||
author_email="[email protected].com", | ||
long_description="XFormers: A collection of composable Transformer building blocks." | ||
+ "XFormers aims at being able to reproduce most architectures in the Transformer-family SOTA," | ||
+ "defined as compatible and combined building blocks as opposed to monolithic models", | ||
|