Merge pull request #12428 from djyasin/updating_setuppy

Updated setup.py --version to python3 -m setuptools_scm.
This commit is contained in:
Shane McDonald
2022-06-30 12:17:54 -04:00
committed by GitHub
13 changed files with 105 additions and 210 deletions

View File

@@ -5,7 +5,7 @@
tasks:
- name: Get version from SCM if not explicitly provided
shell: |
python setup.py --version | cut -d + -f -1
python3 -m setuptools_scm | cut -d + -f -1
args:
chdir: '../../'
register: setup_py_version

View File

@@ -43,7 +43,7 @@ RUN dnf -y update && dnf install -y 'dnf-command(config-manager)' && \
xmlsec1-devel \
xmlsec1-openssl-devel
RUN pip3 install virtualenv
RUN pip3 install virtualenv setuptools_scm build
# Install & build requirements

21
tools/scripts/egg_info_dev Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/env python3
import setuptools
from setuptools.command.egg_info import egg_info as _egg_info
class egg_info_dev(_egg_info):
def find_sources(self):
# when we generate a .egg-info for the development
# environment, it's not really critical that we
# parse the MANIFEST.in (which is actually quite expensive
# in Docker for Mac)
pass
if __name__ == "__main__":
setuptools.setup(
script_name = 'setup.py',
script_args = ['egg_info_dev'],
cmdclass={'egg_info_dev': egg_info_dev},
)

View File

@@ -0,0 +1,4 @@
from setuptools_scm import get_version
version = get_version(root='../..', relative_to=__file__)
print(version)