-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #294 from grawlinson/pep-517-ify
refactor: attempt to modernise build
- Loading branch information
Showing
7 changed files
with
88 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
node: $Format:%H$ | ||
node-date: $Format:%cI$ | ||
describe-name: $Format:%(describe:tags=true)$ | ||
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ | ||
ref-names: $Format:%D$ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
specfile_path: ansible-bender.spec | ||
actions: | ||
create-archive: | ||
- "python3 setup.py sdist --dist-dir ." | ||
- "sh -c 'echo ansible-bender-$(python3 setup.py --version).tar.gz'" | ||
- "python3 -m build" | ||
- "sh -c 'ls -1 dist/ansible-bender-$(python3 -m setuptools_scm).tar.gz'" | ||
get-current-version: | ||
- "python3 setup.py --version" | ||
- "python3 -m setuptools_scm" | ||
jobs: | ||
- job: copr_build | ||
targets: | ||
- fedora-all | ||
- fedora-rawhide | ||
# fedora 36 has old setuptools | ||
- fedora-37 | ||
trigger: pull_request | ||
- job: tests | ||
trigger: pull_request | ||
targets: | ||
- fedora-all | ||
- job: propose_downstream | ||
trigger: release | ||
dist_git_branches: [rawhide] | ||
- fedora-rawhide | ||
- fedora-37 | ||
srpm_build_deps: | ||
- python3-pip # "python3 setup.py --version" needs it | ||
- python3-setuptools_scm | ||
- python3-build | ||
- python3-setuptools | ||
- python3-setuptools_scm |
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 |
---|---|---|
|
@@ -16,9 +16,10 @@ Source0: %{pypi_source} | |
|
||
BuildArch: noarch | ||
|
||
BuildRequires: python%{python3_pkgversion}-devel | ||
BuildRequires: python%{python3_pkgversion}-setuptools | ||
BuildRequires: python%{python3_pkgversion}-setuptools_scm | ||
BuildRequires: python3-devel | ||
BuildRequires: python3-setuptools | ||
BuildRequires: pyproject-rpm-macros | ||
|
||
%if %{with check} | ||
# These are required for tests: | ||
BuildRequires: python%{python3_pkgversion}-pyyaml | ||
|
@@ -27,7 +28,6 @@ BuildRequires: python%{python3_pkgversion}-jsonschema | |
BuildRequires: python%{python3_pkgversion}-pytest | ||
BuildRequires: python%{python3_pkgversion}-flexmock | ||
BuildRequires: python%{python3_pkgversion}-pytest-xdist | ||
BuildRequires: python%{python3_pkgversion}-libselinux | ||
BuildRequires: ansible-core | ||
BuildRequires: podman | ||
BuildRequires: buildah | ||
|
@@ -37,6 +37,9 @@ Requires: (ansible-core or ansible) | |
Suggests: ansible-core | ||
Requires: buildah | ||
|
||
%generate_buildrequires | ||
%pyproject_buildrequires | ||
|
||
%description | ||
This is a tool which bends containers using Ansible playbooks and | ||
turns them into container images. It has a pluggable builder selection | ||
|
@@ -52,11 +55,12 @@ tl;dr Ansible is the frontend, buildah is the backend. | |
|
||
|
||
%build | ||
%py3_build | ||
%pyproject_wheel | ||
|
||
|
||
%install | ||
%py3_install | ||
%pyproject_install | ||
%pyproject_save_files ansible_bender | ||
|
||
|
||
%if %{with check} | ||
|
@@ -73,15 +77,12 @@ tl;dr Ansible is the frontend, buildah is the backend. | |
%endif | ||
|
||
|
||
%files | ||
%{python3_sitelib}/ansible_bender-*.egg-info/ | ||
%{python3_sitelib}/ansible_bender/ | ||
%files -f %{pyproject_files} | ||
%{_bindir}/ansible-bender | ||
%license LICENSE | ||
%doc docs/* README.md | ||
|
||
|
||
|
||
%changelog | ||
* Mon Feb 06 2023 Tomas Tomecek <[email protected]> - 0.10.1-1 | ||
- 0.10.1 upstream release | ||
|
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,63 @@ | ||
[project] | ||
name = "ansible-bender" | ||
authors = [ | ||
{name = "Tomas Tomecek", email = "[email protected]"}, | ||
] | ||
description = "A tool which builds container images using Ansible playbooks" | ||
readme = "README.md" | ||
requires-python = ">= 3.6" | ||
keywords = [ | ||
"ansible", | ||
"containers", | ||
"linux", | ||
"buildah", | ||
] | ||
license = {text = "MIT"} | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Software Development", | ||
"Topic :: Utilities", | ||
] | ||
dependencies = [ | ||
"PyYAML", | ||
"tabulate", | ||
"jsonschema", | ||
"setuptools", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
homepage = "https://github.com/ansible-community/ansible-bender" | ||
documentation = "https://ansible-community.github.io/ansible-bender/build/html/index.html" | ||
|
||
[project.optional-dependencies] | ||
testing = [ | ||
"pytest", | ||
"flexmock", | ||
"pytest-cov", | ||
] | ||
|
||
[project.scripts] | ||
ansible-bender = "ansible_bender.cli:main" | ||
|
||
# reference for usage: | ||
# https://github.com/pypa/setuptools_scm/#pyprojecttoml-usage | ||
[tool.setuptools_scm] | ||
|
||
# references for minimum version selection: | ||
# setuptools: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html | ||
# setuptools-scm: https://github.com/pypa/setuptools_scm/#pyprojecttoml-usage | ||
[build-system] | ||
requires = ["setuptools>=61", "setuptools-scm[toml]>=6.2"] | ||
build-backend = "setuptools.build_meta" |
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 |
---|---|---|
@@ -1,63 +1,8 @@ | ||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[metadata] | ||
name = ansible-bender | ||
url = https://github.com/ansible-community/ansible-bender | ||
description = A tool which builds container images using Ansible playbooks | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
author = Tomas Tomecek | ||
author_email = [email protected] | ||
license = MIT | ||
license_file = LICENSE | ||
classifiers = | ||
Development Status :: 5 - Production/Stable | ||
Environment :: Console | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: MIT License | ||
Operating System :: POSIX :: Linux | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
Programming Language :: Python :: 3.11 | ||
Topic :: Software Development | ||
Topic :: Utilities | ||
keywords = | ||
ansible | ||
containers | ||
linux | ||
buildah | ||
|
||
|
||
[options] | ||
python_requires = >=3.6 | ||
packages = find: | ||
include_package_data = True | ||
|
||
setup_requires = | ||
setuptools_scm | ||
|
||
install_requires = | ||
PyYAML | ||
tabulate | ||
jsonschema | ||
setuptools | ||
|
||
[options.packages.find] | ||
exclude = | ||
tests | ||
tests.* | ||
|
||
[options.extras_require] | ||
testing = | ||
pytest | ||
flexmock | ||
pytest-cov | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
ansible-bender = ansible_bender.cli:main |