Skip to content

BLD: Fix version script #54525

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

Merged
merged 3 commits into from
Aug 15, 2023
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 .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
fi
- run:
name: Build aarch64 wheels
no_output_timeout: 30m # Sometimes the tests won't generate any output, make sure the job doesn't get killed by that
command: |
pip3 install cibuildwheel==2.14.1
cibuildwheel --prerelease-pythons --output-dir wheelhouse
Expand Down
28 changes: 23 additions & 5 deletions generate_version.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
# Note: This file has to live next to setup.py or versioneer will not work
import argparse
import os
import sys

import versioneer

sys.path.insert(0, "")


def write_version_info(path):
version = None
git_version = None

try:
import _version_meson

version = _version_meson.__version__
git_version = _version_meson.__git_version__
except ImportError:
version = versioneer.get_version()
git_version = versioneer.get_versions()["full-revisionid"]
if os.environ.get("MESON_DIST_ROOT"):
path = os.path.join(os.environ.get("MESON_DIST_ROOT"), path)
with open(path, "w", encoding="utf-8") as file:
file.write(f'__version__="{versioneer.get_version()}"\n')
file.write(
f'__git_version__="{versioneer.get_versions()["full-revisionid"]}"\n'
)
file.write(f'__version__="{version}"\n')
file.write(f'__git_version__="{git_version}"\n')


def main():
Expand Down Expand Up @@ -43,7 +55,13 @@ def main():
write_version_info(args.outfile)

if args.print:
print(versioneer.get_version())
try:
import _version_meson

version = _version_meson.__version__
except ImportError:
version = versioneer.get_version()
print(version)


main()
1 change: 1 addition & 0 deletions scripts/validate_unwanted_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"_global_config",
"_chained_assignment_msg",
"_chained_assignment_method_msg",
"_version_meson",
}


Expand Down