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 3139a91
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 48 deletions.
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
11 changes: 9 additions & 2 deletions qpc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ Source0: %{url}/archive/%{version}.tar.gz

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

Requires: python%{python3_pkgversion}
Requires: python%{python3_pkgversion}-cryptography
Expand All @@ -26,11 +30,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 3139a91

Please sign in to comment.