-
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
4 changed files
with
52 additions
and
30 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 @@ | ||
v0.1.6 |
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
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
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,34 +2,42 @@ | |
import subprocess | ||
import os | ||
|
||
# package_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() | ||
) | ||
print(package_version) | ||
|
||
# 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 | ||
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 package_version | ||
# assert "." in package_version | ||
v_strs = package_version.split(".") | ||
print(v_strs) | ||
package_version = ".".join(v_strs[:-1]) + '.' + str(int(v_strs[-1])+1) | ||
assert "-" not in package_version | ||
assert "." in package_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) | ||
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.1.5', | ||
# version=package_version, | ||
# version='0.1.6', | ||
version=package_version, | ||
# setuptools_git_versioning={ | ||
# "enabled": True, | ||
# }, | ||
# setup_requires=["setuptools-git-versioning>=2.0,<3"], | ||
# author="Jue XU", | ||
author_email="[email protected]", | ||
description="Recipe for quantum simulation", | ||
|