diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-06-17 16:43:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-17 16:43:02 +0100 |
| commit | 66538d8cee51e1adee5b489e6e16429ac0ce239a (patch) | |
| tree | 1afaae4e9db324cc85d03fc5307c691aa5828293 /setuptools/command | |
| parent | daaf3ab8dcf1c64fa4acd4bb30271931d7b6af26 (diff) | |
| parent | a19c4dfb8f7fda86a755b181bbf5819fc4139ab7 (diff) | |
| download | python-setuptools-git-66538d8cee51e1adee5b489e6e16429ac0ce239a.tar.gz | |
Handle `config_settings` as they would be passed by pip (#3380)
Diffstat (limited to 'setuptools/command')
| -rw-r--r-- | setuptools/command/dist_info.py | 21 | ||||
| -rw-r--r-- | setuptools/command/editable_wheel.py | 18 |
2 files changed, 38 insertions, 1 deletions
diff --git a/setuptools/command/dist_info.py b/setuptools/command/dist_info.py index aa7af48c..39a74e1e 100644 --- a/setuptools/command/dist_info.py +++ b/setuptools/command/dist_info.py @@ -25,13 +25,21 @@ class dist_info(Command): " DEPRECATED: use --output-dir."), ('output-dir=', 'o', "directory inside of which the .dist-info will be" "created (default: top of the source tree)"), + ('tag-date', 'd', "Add date stamp (e.g. 20050528) to version number"), + ('tag-build=', 'b', "Specify explicit tag to add to version number"), + ('no-date', 'D', "Don't include date stamp [default]"), ] + boolean_options = ['tag-date'] + negative_opt = {'no-date': 'tag-date'} + def initialize_options(self): self.egg_base = None self.output_dir = None self.name = None self.dist_info_dir = None + self.tag_date = None + self.tag_build = None def finalize_options(self): if self.egg_base: @@ -43,8 +51,19 @@ class dist_info(Command): project_dir = dist.src_root or os.curdir self.output_dir = Path(self.output_dir or project_dir) - egg_info = self.reinitialize_command('egg_info') + egg_info = self.reinitialize_command("egg_info") egg_info.egg_base = str(self.output_dir) + + if self.tag_date: + egg_info.tag_date = self.tag_date + else: + self.tag_date = egg_info.tag_date + + if self.tag_build: + egg_info.tag_build = self.tag_build + else: + self.tag_build = egg_info.tag_build + egg_info.finalize_options() self.egg_info = egg_info diff --git a/setuptools/command/editable_wheel.py b/setuptools/command/editable_wheel.py index 48202990..2776577f 100644 --- a/setuptools/command/editable_wheel.py +++ b/setuptools/command/editable_wheel.py @@ -15,6 +15,7 @@ import re import shutil import sys import logging +import warnings from itertools import chain from pathlib import Path from tempfile import TemporaryDirectory @@ -166,6 +167,15 @@ class editable_wheel(Command): populate = _LinkTree(self.distribution, name, auxiliary_build_dir, tmp) populate(unpacked_dir) + msg = f"""\n + Strict editable installation performed using the auxiliary directory: + {auxiliary_build_dir} + + Please be careful to not remove this directory, otherwise you might not be able + to import/use your package. + """ + warnings.warn(msg, InformationOnly) + def _populate_static_pth(self, name: str, project_dir: Path, unpacked_dir: Path): """Populate wheel using the "lax" ``.pth`` file strategy, for ``src-layout``.""" src_dir = self.package_dir[""] @@ -583,3 +593,11 @@ def _finder_template( """ mapping = dict(sorted(mapping.items(), key=lambda p: p[0])) return _FINDER_TEMPLATE.format(name=name, mapping=mapping, namespaces=namespaces) + + +class InformationOnly(UserWarning): + """Currently there is no clear way of displaying messages to the users + that use the setuptools backend directly via ``pip``. + The only thing that might work is a warning, although it is not the + most appropriate tool for the job... + """ |
