[F] Fix version detection
This commit is contained in:
parent
8cc06c02b5
commit
3a80670491
2 changed files with 5 additions and 4 deletions
|
|
@ -3,7 +3,7 @@ resolver = "2"
|
||||||
members = ["crates/*"]
|
members = ["crates/*"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "2.0.0"
|
version = "2.0.0-rc1"
|
||||||
authors = ["Azalea Gui <azalea@hydev.org>"]
|
authors = ["Azalea Gui <azalea@hydev.org>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.75.0"
|
rust-version = "1.75.0"
|
||||||
|
|
|
||||||
7
setup.py
7
setup.py
|
|
@ -6,9 +6,10 @@ from setuptools import setup, find_namespace_packages
|
||||||
HERE = Path(__file__).parent
|
HERE = Path(__file__).parent
|
||||||
|
|
||||||
# Load version without importing it (see issue #192 if you are confused)
|
# Load version without importing it (see issue #192 if you are confused)
|
||||||
VERSION = ""
|
VERSION = [l for l in (HERE / "Cargo.toml").read_text('utf-8').splitlines() if l.startswith("version = ")]
|
||||||
for l in (HERE / 'hyfetch' / '__version__.py').read_text().strip().splitlines():
|
if len(VERSION) != 1:
|
||||||
exec(l)
|
raise ValueError(f"Cannot determine version from Cargo.toml: {VERSION}")
|
||||||
|
VERSION = VERSION[0].split('"')[1]
|
||||||
|
|
||||||
# The text of the README file
|
# The text of the README file
|
||||||
README = (HERE / "README.md").read_text('utf-8')
|
README = (HERE / "README.md").read_text('utf-8')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue