diff options
author | Tim Harder <radhermit@gmail.com> | 2021-03-20 15:27:13 -0600 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2021-03-20 15:45:25 -0600 |
commit | 180168d4dd666a6af04b5ed4bf3105c1b5384317 (patch) | |
tree | c5e2f4a8531034c1445e9f687f1a51556d0f2a69 /src/snakeoil/dist | |
parent | github: force cibuildwheel to use dist dir for output (diff) | |
download | snakeoil-180168d4dd666a6af04b5ed4bf3105c1b5384317.tar.gz snakeoil-180168d4dd666a6af04b5ed4bf3105c1b5384317.tar.bz2 snakeoil-180168d4dd666a6af04b5ed4bf3105c1b5384317.zip |
dist.distutils_extensions: replace pyproject.toml for sdist
Diffstat (limited to 'src/snakeoil/dist')
-rw-r--r-- | src/snakeoil/dist/distutils_extensions.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/snakeoil/dist/distutils_extensions.py b/src/snakeoil/dist/distutils_extensions.py index 55bff23e..6e2feb2a 100644 --- a/src/snakeoil/dist/distutils_extensions.py +++ b/src/snakeoil/dist/distutils_extensions.py @@ -354,7 +354,6 @@ class sdist(dst_sdist.sdist): into the release and adds generated files that should not exist in a working tree. """ - build_man = self.reinitialize_command('build_man') # force sphinx to run at our chosen verbosity build_man.verbosity = self.verbose @@ -365,11 +364,21 @@ class sdist(dst_sdist.sdist): os.path.join(base_dir, dist_path)) dst_sdist.sdist.make_release_tree(self, base_dir, files) + + # generate version module build_py = self.reinitialize_command('build_py') build_py.ensure_finalized() generate_verinfo(os.path.join( base_dir, build_py.package_dir.get('', ''), MODULE_NAME)) + # replace pyproject.toml file with release version if it exists + try: + shutil.copy( + os.path.join(base_dir, 'requirements', 'pyproject.toml'), + os.path.join(base_dir)) + except FileNotFoundError: + pass + def run(self): build_ext = self.reinitialize_command('build_ext') build_ext.ensure_finalized() |