mirror of
https://github.com/danieldemus/pyp2spec.git
synced 2026-07-27 21:00:37 +02:00
Remove obsolete bits allowing to manually define extras
They were partially defunct, made no actual sense and need to be forgotten without mercy. Generating extras for %pyproject_buildrequires (-x foo) will be improved. For tox dependencies (-t), the users can manually add it to the resulting spec file.
This commit is contained in:
committed by
Karolina Surma
parent
641195404c
commit
4244c2a3ae
@@ -101,8 +101,6 @@ Configuration data is stored in a TOML file.
|
||||
| Field | Description | Type |
|
||||
| -------- | -------- | -------- |
|
||||
| manual_build_requires | additional build requires, eg. `python3-sphinx` | list |
|
||||
| extra_build_requires | extra options to %pyproject_buildrequires (`-t`, `-x`) | list |
|
||||
| extra_tox_env | if `-x` is defined as extra, provide name of the tox env | list |
|
||||
| test_method | `pytest`, `tox` | string |
|
||||
| test_top_level | filter and test only top-level modules in %check | bool |
|
||||
| unwanted_tests | test names to skip with pytest | list |
|
||||
|
||||
@@ -62,33 +62,6 @@ class ConfigFile:
|
||||
return val
|
||||
|
||||
|
||||
def generate_extra_build_requires(config):
|
||||
"""If defined in config file, return extra build requires.
|
||||
If none were defined, return an empty string."""
|
||||
|
||||
# TODO: custom tox env (-e)
|
||||
options = {
|
||||
"tox": "-t",
|
||||
"extra": "-x",
|
||||
}
|
||||
extra_brs = config.get_list("extra_build_requires")
|
||||
|
||||
# No extra BuildRequires were defined - return an empty string
|
||||
if not extra_brs:
|
||||
return ""
|
||||
|
||||
generated_brs = []
|
||||
add = generated_brs.append
|
||||
for extra_br in extra_brs:
|
||||
if extra_br == "extra":
|
||||
add(options.get(extra_br))
|
||||
add(",".join(config.get_list("extra_test_env")))
|
||||
else:
|
||||
add(options.get(extra_br))
|
||||
|
||||
return " ".join(generated_brs)
|
||||
|
||||
|
||||
def generate_check(config):
|
||||
"""Generate valid check section.
|
||||
If defined in config file, use applicable test macro.
|
||||
@@ -159,7 +132,6 @@ def fill_in_template(config):
|
||||
binary_files=config.get_list("binary_files"),
|
||||
description=wrap_description(config),
|
||||
doc_files=" ".join(config.get_list("doc_files")),
|
||||
extra_build_requires=generate_extra_build_requires(config),
|
||||
extras=",".join(config.get_list("extras")),
|
||||
license_files=" ".join(config.get_list("license_files")),
|
||||
license=config.get_string("license"),
|
||||
|
||||
@@ -40,7 +40,7 @@ Summary: %{summary}
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires{% if extra_build_requires %} {{extra_build_requires}}{% endif %}
|
||||
%pyproject_buildrequires
|
||||
|
||||
|
||||
%build
|
||||
|
||||
@@ -66,18 +66,6 @@ def test_top_level_flag_is_loaded(config_dir, conf, expected):
|
||||
assert config.get_bool("test_top_level") == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("conf", "expected"), [
|
||||
("customized_click.conf", "-t"),
|
||||
("customized_jupyter-packaging.conf", "-x test"),
|
||||
]
|
||||
)
|
||||
def test_br_extra_is_generated(config_dir, conf, expected):
|
||||
config_path = config_dir + conf
|
||||
config = conf2spec.ConfigFile(config_path)
|
||||
assert conf2spec.generate_extra_build_requires(config) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("conf", "expected"), [
|
||||
("customized_boutdata.conf", ["LICENSE"]),
|
||||
|
||||
@@ -14,7 +14,6 @@ It's the "Command Line Interface Creation Kit". It's highly configurable but
|
||||
comes with good defaults out of the box.
|
||||
'''
|
||||
|
||||
extra_build_requires = ["tox"]
|
||||
test_method = "tox"
|
||||
|
||||
license_files = ["LICENSE.rst"]
|
||||
|
||||
@@ -9,9 +9,6 @@ source = "%{pypi_source jupyter_packaging}"
|
||||
archive_name = "jupyter_packaging"
|
||||
description = "This package contains utilities for making Python packages with and without accompanying JavaScript packages."
|
||||
|
||||
extra_build_requires = ["extra"]
|
||||
extra_test_env = ["test"]
|
||||
|
||||
test_method = "pytest"
|
||||
unwanted_tests = [
|
||||
"test_build_package",
|
||||
|
||||
Reference in New Issue
Block a user