mirror of
https://github.com/danieldemus/pyp2spec.git
synced 2026-07-29 05:34:22 +02:00
Initial commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
name = "click"
|
||||
python_name = "python-click"
|
||||
module_name = "click"
|
||||
version = "7.1.2"
|
||||
release = "6"
|
||||
summary = "Simple wrapper around optparse for powerful command line utilities"
|
||||
license = "BSD"
|
||||
url = "https://github.com/mitsuhiko/click"
|
||||
source = "%{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz"
|
||||
description = '''
|
||||
click is a Python package for creating beautiful command line\
|
||||
interfaces in a composable way with as little amount of code as necessary.\
|
||||
It's the "Command Line Interface Creation Kit". It's highly configurable but\
|
||||
comes with good defaults out of the box.
|
||||
'''
|
||||
|
||||
extra_build_requires = "test"
|
||||
test = "tox"
|
||||
|
||||
[files]
|
||||
license_files = ["LICENSE.rst"]
|
||||
doc_files = ["README.rst", "CHANGES.rst"]
|
||||
|
||||
[changelog]
|
||||
changelog_head = "Wed Jun 02 2021 Package Maintainer <package@maintainer.com>"
|
||||
changelog_msg = "Rebuilt for Python 3.10"
|
||||
@@ -0,0 +1,57 @@
|
||||
Name: python-click
|
||||
Version: 7.1.2
|
||||
Release: 6%{?dist}
|
||||
Summary: Simple wrapper around optparse for powerful command line utilities
|
||||
|
||||
License: BSD
|
||||
URL: https://github.com/mitsuhiko/click
|
||||
Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
|
||||
%global _description %{expand:
|
||||
click is a Python package for creating beautiful command line\
|
||||
interfaces in a composable way with as little amount of code as necessary.\
|
||||
It's the "Command Line Interface Creation Kit". It's highly configurable but\
|
||||
comes with good defaults out of the box.
|
||||
}
|
||||
|
||||
|
||||
%description %_description
|
||||
|
||||
%package -n python3-click
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-click %_description
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n click-%{version}
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -t
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files click
|
||||
|
||||
|
||||
%check
|
||||
%tox
|
||||
|
||||
|
||||
%files -n python3-click -f %{pyproject_files}
|
||||
%doc README.rst CHANGES.rst
|
||||
%license LICENSE.rst
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jun 02 2021 Package Maintainer <package@maintainer.com> - 7.1.2-6
|
||||
- Rebuilt for Python 3.10
|
||||
@@ -0,0 +1,32 @@
|
||||
name = "tomli"
|
||||
python_name = "python-tomli"
|
||||
module_name = "tomli"
|
||||
version = "1.1.0"
|
||||
release = "1"
|
||||
summary = "A little TOML parser for Python"
|
||||
license = "MIT"
|
||||
url = "https://pypi.org/project/tomli/"
|
||||
source = "https://github.com/hukkin/tomli/archive/refs/tags/%{version}.tar.gz"
|
||||
description = '''
|
||||
Tomli is a Python library for parsing TOML.
|
||||
Tomli is fully compatible with TOML v1.0.0.
|
||||
'''
|
||||
|
||||
manual_build_requires = [
|
||||
"python3-pytest",
|
||||
"python3-dateutil",
|
||||
]
|
||||
|
||||
extra_build_requires = "runtime"
|
||||
test = "pytest"
|
||||
|
||||
[files]
|
||||
license_files = ["LICENSE"]
|
||||
doc_files = ["README.md", "CHANGELOG.md"]
|
||||
|
||||
[changelog]
|
||||
changelog_head = "Thu Jul 29 2021 Package Maintainer <package@maintainer.com>"
|
||||
changelog_msg = '''
|
||||
Update to version 1.1.0
|
||||
- `load` can now take a binary file object
|
||||
'''
|
||||
@@ -0,0 +1,58 @@
|
||||
Name: python-tomli
|
||||
Version: 1.1.0
|
||||
Release: 1%{?dist}
|
||||
Summary: A little TOML parser for Python
|
||||
|
||||
License: MIT
|
||||
URL: https://pypi.org/project/tomli/
|
||||
Source0: https://github.com/hukkin/tomli/archive/refs/tags/%{version}.tar.gz
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
|
||||
%global _description %{expand:
|
||||
Tomli is a Python library for parsing TOML.
|
||||
Tomli is fully compatible with TOML v1.0.0.
|
||||
}
|
||||
|
||||
BuildRequires: python3-pytest
|
||||
BuildRequires: python3-dateutil
|
||||
|
||||
%description %_description
|
||||
|
||||
%package -n python3-tomli
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-tomli %_description
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n tomli-%{version}
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -r
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files tomli
|
||||
|
||||
|
||||
%check
|
||||
%pytest
|
||||
|
||||
|
||||
%files -n python3-tomli -f %{pyproject_files}
|
||||
%doc README.md CHANGELOG.md
|
||||
%license LICENSE
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Jul 29 2021 Package Maintainer <package@maintainer.com> - 1.1.0-1
|
||||
- Update to version 1.1.0
|
||||
- `load` can now take a binary file object
|
||||
@@ -0,0 +1,37 @@
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
|
||||
import conf2spec
|
||||
|
||||
|
||||
def get_test_cases():
|
||||
"""Go through all 'tests/' folders and get their names.
|
||||
Yield the next folder name."""
|
||||
|
||||
source_path = Path("tests/")
|
||||
for path in source_path.glob("pyp2spec_*"):
|
||||
yield path.name
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("test_case"),
|
||||
get_test_cases(),
|
||||
)
|
||||
def test_generated_specfile(test_case):
|
||||
# Get config and expected resulting file
|
||||
config_file = Path("tests/") / test_case / f"{test_case}.conf"
|
||||
expected_file = Path("tests/") / test_case / f"{test_case}.spec"
|
||||
|
||||
# Run the conf2spec converter
|
||||
conf = conf2spec.load_configuration(config_file)
|
||||
rendered_file = conf2spec.write_spec_file(conf)
|
||||
|
||||
# Compare the results
|
||||
with open(rendered_file, "r") as rendered_f:
|
||||
rendered = rendered_f.read()
|
||||
with open(expected_file, "r") as expected_f:
|
||||
expected = expected_f.read()
|
||||
assert rendered == expected
|
||||
|
||||
# Delete rendered file
|
||||
Path(rendered_file).unlink()
|
||||
Reference in New Issue
Block a user