-
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.
- Loading branch information
Showing
2 changed files
with
34 additions
and
22 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os | ||
|
||
|
||
def string(): | ||
try: | ||
with open(os.path.dirname(__file__) + "/VERSION", "r", encoding="utf-8") as fh: | ||
version = fh.read().strip() | ||
if version: | ||
return version | ||
except: | ||
pass | ||
return "unknown (git checkout)" |
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 |
---|---|---|
|
@@ -2,43 +2,43 @@ | |
import subprocess | ||
import os | ||
|
||
# cf_remote_version = ( | ||
# subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE) | ||
# .stdout.decode("utf-8") | ||
# .strip() | ||
# ) | ||
package_version = ( | ||
subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE) | ||
.stdout.decode("utf-8") | ||
.strip() | ||
) | ||
|
||
# if "-" in cf_remote_version: | ||
# # when not on tag, git describe outputs: "1.3.3-22-gdf81228" | ||
# # pip has gotten strict with version numbers | ||
# # so change it to: "1.3.3+22.git.gdf81228" | ||
# # See: https://peps.python.org/pep-0440/#local-version-segments | ||
# v,i,s = cf_remote_version.split("-") | ||
# cf_remote_version = v + "+" + i + ".git." + s | ||
if "-" in package_version: | ||
# when not on tag, git describe outputs: "1.3.3-22-gdf81228" | ||
# pip has gotten strict with version numbers | ||
# so change it to: "1.3.3+22.git.gdf81228" | ||
# See: https://peps.python.org/pep-0440/#local-version-segments | ||
v,i,s = package_version.split("-") | ||
package_version = v + "+" + i + ".git." + s | ||
|
||
# assert "-" not in cf_remote_version | ||
# assert "." in cf_remote_version | ||
assert "-" not in package_version | ||
assert "." in package_version | ||
|
||
# assert os.path.isfile("cf_remote/version.py") | ||
# with open("cf_remote/VERSION", "w", encoding="utf-8") as fh: | ||
# fh.write("%s\n" % cf_remote_version) | ||
assert os.path.isfile("quantum_simulation_recipe/version.py") | ||
with open("quantum_simulation_recipe/VERSION", "w", encoding="utf-8") as fh: | ||
fh.write("%s\n" % package_version) | ||
|
||
with open("README.md", "r", encoding="utf-8") as fh: | ||
long_description = fh.read() | ||
|
||
setuptools.setup( | ||
name="quantum-simulation-recipe", | ||
version='0.0.3', | ||
# version=cf_remote_version, | ||
author="Jue XU", | ||
# version='0.0.3', | ||
version=package_version, | ||
# author="Jue XU", | ||
author_email="[email protected]", | ||
description="Recipe for quantum simulation", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/Jue-Xu/quantum-simulation-recipe", | ||
packages=setuptools.find_packages(include=["quantum_simulation_recipe"]), | ||
# package_data={"cf_remote": ["VERSION"]}, | ||
# include_package_data=True, | ||
package_data={"quantum_simulation_recipe": ["VERSION"]}, | ||
include_package_data=True, | ||
license="Apache-2.0", | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
|