Skip to content

Commit

Permalink
chore: making qpc a poetry only project
Browse files Browse the repository at this point in the history
- Eliminating the setup.py
- Updating make install to leverage pipx instead of setup.py
  • Loading branch information
abellotti committed May 31, 2024
1 parent e44aa14 commit 15e73a6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 58 deletions.
20 changes: 10 additions & 10 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ jobs:
targets: &targets_list
# we officially support rhel-8 and rhel-9 downstream.
- rhel-8-x86_64
- rhel-8-aarch64
# - rhel-8-aarch64
- rhel-9-x86_64
- rhel-9-aarch64
# - rhel-9-aarch64
# centos-stream is like a preview of upcoming rhel.
- centos-stream-8-x86_64
- centos-stream-8-aarch64
- centos-stream-9-x86_64
- centos-stream-9-aarch64
# - centos-stream-8-x86_64
# - centos-stream-8-aarch64
# - centos-stream-9-x86_64
# - centos-stream-9-aarch64
# fedora is like an even farther future preview.
- fedora-39-x86_64
- fedora-39-aarch64
- fedora-40-x86_64
- fedora-40-aarch64
# - fedora-39-x86_64
# - fedora-39-aarch64
# - fedora-40-x86_64
# - fedora-40-aarch64

- job: copr_build
trigger: commit
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ clean:
find . -type d -name __pycache__ -delete

install:
$(PYTHON) setup.py build -f
$(PYTHON) setup.py install -f
poetry run pipx install .

lint: lint-ruff lint-docs

Expand Down
13 changes: 7 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[project]
name = "qpc"
version = "1.8.0"
license = {file = "LICENSE"}
requires-python = ">=3.11,<3.13"
dynamic = ["scripts"]
Expand All @@ -26,7 +24,7 @@ qpc = 'qpc.__main__:main'
python = ">=3.11,<3.13"
requests = ">=2.28.1"
cryptography = ">=37.0.4"
setuptools = "^70.0.0"
setuptools = "69.0.3"
faker = "^20.0.3"

[tool.poetry.group.dev.dependencies]
Expand Down
12 changes: 10 additions & 2 deletions qpc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ URL: https://github.com/quipucords/qpc
Source0: %{url}/archive/%{version}.tar.gz

BuildArch: noarch
BuildRequires: epel-release
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-pip
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-wheel
BuildRequires: python3-poetry-core
BuildRequires: pyproject-rpm-macros

Requires: python%{python3_pkgversion}
Requires: python%{python3_pkgversion}-cryptography
Expand All @@ -26,11 +31,14 @@ qpc is the command-line client interface for the quipucords server.
%prep
%autosetup -n qpc-%{version}

%generate_buildrequires
%pyproject_buildrequires

%build
%py3_build
%pyproject_wheel

%install
QPC_VAR_PROGRAM_NAME=qpc %py3_install
QPC_VAR_PROGRAM_NAME=qpc %pyproject_install
mkdir -p %{buildroot}%{_mandir}/man1/
sed \
-e "s/QPC_VAR_PROGRAM_NAME/qpc/g" \
Expand Down
3 changes: 1 addition & 2 deletions qpc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
__package__version__ = metadata.version(__package__)
except metadata.PackageNotFoundError:
# PackageNotFoundError may be raised if *not* called from
# within a poetry environment, such as during execution of
# `python setup.py install` in downstream builds.
# within a poetry environment.
# As a failsafe, try to load the version defined for poetry
# from the pyproject.toml.
toml_path = Path(__file__).absolute().parent.parent / "pyproject.toml"
Expand Down
33 changes: 0 additions & 33 deletions setup.py

This file was deleted.

0 comments on commit 15e73a6

Please sign in to comment.