-
-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: respect three components Python version (#1295)
Co-authored-by: Ofek Lev <[email protected]>
- Loading branch information
Showing
4 changed files
with
82 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
tests/helpers/templates/wheel/standard_default_python_constraint_three_components.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from hatch.template import File | ||
from hatch.utils.fs import Path | ||
from hatchling.__about__ import __version__ | ||
from hatchling.metadata.spec import DEFAULT_METADATA_VERSION | ||
|
||
from ..new.feature_no_src_layout import get_files as get_template_files | ||
from .utils import update_record_file_contents | ||
|
||
|
||
def get_files(**kwargs): | ||
metadata_directory = kwargs.get('metadata_directory', '') | ||
|
||
files = [] | ||
for f in get_template_files(**kwargs): | ||
if str(f.path) == 'LICENSE.txt': | ||
files.append(File(Path(metadata_directory, 'licenses', f.path), f.contents)) | ||
|
||
if f.path.parts[0] != kwargs['package_name']: | ||
continue | ||
|
||
files.append(f) | ||
|
||
files.extend(( | ||
File( | ||
Path(metadata_directory, 'WHEEL'), | ||
f"""\ | ||
Wheel-Version: 1.0 | ||
Generator: hatchling {__version__} | ||
Root-Is-Purelib: true | ||
Tag: py3-none-any | ||
""", | ||
), | ||
File( | ||
Path(metadata_directory, 'METADATA'), | ||
f"""\ | ||
Metadata-Version: {DEFAULT_METADATA_VERSION} | ||
Name: {kwargs['project_name']} | ||
Version: 0.0.1 | ||
License-File: LICENSE.txt | ||
Requires-Python: ==3.11.4 | ||
""", | ||
), | ||
)) | ||
|
||
record_file = File(Path(metadata_directory, 'RECORD'), '') | ||
update_record_file_contents(record_file, files) | ||
files.append(record_file) | ||
|
||
return files |