Skip to content

Commit

Permalink
0.0.21: normalize project name for filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
rjdbcm committed Jun 16, 2024
1 parent 0a4bbe9 commit 2810778
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions ozi_build/buildapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,7 @@ def prepare_metadata_for_build_wheel(

dist_info = Path(
metadata_directory,
'{}-{}.dist-info'.format(config['module'].replace(
'.', '_', 1).replace('.', '').replace('-', '_', 1).replace('-', '_'), config['version']),
'{}-{}.dist-info'.format(config['module'], config['version']),
)
dist_info.mkdir(exist_ok=True)

Expand Down Expand Up @@ -396,8 +395,7 @@ def build(self, wheel_directory, config_settings, metadata_dir):
abi = config.get('requires-python', get_abi(python))

target_fp = wheel_directory / '{}-{}-{}-{}.whl'.format(
config['module'].replace(
'.', '_', 1).replace('.', '').replace('-', '_', 1).replace('-', '_'),
config['module'].replace('-', '_', 1).replace('-', '_'),
config['version'],
abi,
platform_tag,
Expand Down Expand Up @@ -470,8 +468,7 @@ def build_sdist(sdist_directory, config_settings=None):
mesondisttar.extract(entry, installdir)
# OZI uses setuptools_scm to create PKG-INFO
pkg_info = config.get_metadata()
distfilename = '{}-{}.tar.gz'.format(config['module'].replace(
'.', '_', 1).replace('.', '').replace('-', '_', 1).replace('-', '_'), config['version'])
distfilename = '{}-{}.tar.gz'.format(config['module'], config['version'])
target = distdir / distfilename
source_date_epoch = os.environ.get('SOURCE_DATE_EPOCH', '')
mtime = int(source_date_epoch) if source_date_epoch else None
Expand All @@ -483,8 +480,7 @@ def build_sdist(sdist_directory, config_settings=None):
fileobj=gz,
format=tarfile.PAX_FORMAT,
) as tf:
tf.add(tf_dir, arcname='{}-{}'.format(config['module'].replace(
'.', '_', 1).replace('.', '').replace('-', '_', 1).replace('-', '_'), config['version']), recursive=True)
tf.add(tf_dir, recursive=True)
pkginfo_path = Path(installdir) / tf_dir / 'PKG-INFO'
if not pkginfo_path.exists():
with open(pkginfo_path, mode='w') as fpkginfo:
Expand Down

0 comments on commit 2810778

Please sign in to comment.