diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..c607023 --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,38 @@ +specfile_path: packaging/shellai.spec +upstream_package_name: shellai +downstream_package_name: shellai +upstream_project_url: https://github.com/rhel-lightspeed/shellai + +srpm_build_deps: [] + +jobs: + # Build RPMs for each pull request + - job: copr_build + trigger: pull_request + owner: "@rhel-lightspeed" + project: shellai + targets: + - epel-8-x86_64 + - epel-9-x86_64 + actions: + # do not get the version from a tag (git describe) but from the spec file + get-current-version: + - grep -oP '^Version:\s+\K\S+' packaging/shellai.spec + + # Build RPMs for main branch + - job: copr_build + trigger: commit + branch: main + owner: "@rhel-lightspeed" + project: shellai + targets: + - epel-8-x86_64 + - epel-9-x86_64 + actions: + # bump spec so we get release starting with 2 and hence all the default branch builds will + # have higher NVR than all the PR builds + post-upstream-clone: + - rpmdev-bumpspec --comment='latest upstream build' ./packaging/shellai.spec + # do not get the version from a tag (git describe) but from the spec file + get-current-version: + - grep -oP '^Version:\s+\K\S+' packaging/shellai.spec diff --git a/Makefile b/Makefile index be85d6b..b2a5933 100644 --- a/Makefile +++ b/Makefile @@ -34,4 +34,4 @@ clean: ## Clean project files @find . -name '__pycache__' -exec rm -fr {} + @find . -name '*.pyc' -exec rm -f {} + @find . -name '*.pyo' -exec rm -f {} + - @rm -rf .pdm-build .ruff_cache .coverage .pdm-python + @rm -rf .pdm-build .ruff_cache .coverage .pdm-python dist diff --git a/packaging/shellai.spec b/packaging/shellai.spec new file mode 100644 index 0000000..4ccc0b2 --- /dev/null +++ b/packaging/shellai.spec @@ -0,0 +1,40 @@ +Name: shellai +Version: 0.1.0 +Release: 1%{?dist} +Summary: A simple wrapper to interact with RAG + +License: Apache v2 +URL: https://github.com/rhel-lightspeed/shellai +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +BuildArch: noarch + +BuildRequires: pyproject-rpm-macros +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-pip +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-wheel + +Requires: python%{python3_pkgversion}-requests +Requires: python%{python3_pkgversion}-pyyaml + +%description +A simple wrapper to interact with RAG + +%prep +%autosetup + +%build +%pyproject_wheel + +%install +# TODO(r0x0d): Create config file +%pyproject_install + + +%files +ls %{_bindir}/ +%license LICENSE +%doc README.md +%{_bindir}/%{name} + +%changelog diff --git a/pyproject.toml b/pyproject.toml index 689b8d7..5cbcd2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,8 +9,8 @@ maintainers = [ { name = "Rodolfo Olivieri", email = "rolivier@redhat.com" }, { name = "Major Hayden", email = "mhayden@redhat.com" }, ] -dependencies = ["requests", "pyyaml"] -requires-python = ">=3.8,<=3.9" +dependencies = ["setuptools", "requests", "pyyaml"] +requires-python = ">=3.6" readme = "README.md" license = { file = "LICENSE" } classifiers = ["Programming Language :: Python :: 3"] @@ -23,11 +23,15 @@ Issues = "https://github.com/rhel-lightspeed/shellai/issues" shellai = "shellai.__main__:main" [build-system] -requires = ["pdm-backend"] -build-backend = "pdm.backend" +requires = ["setuptools"] +# pdm build is not available in rhel baseos repositories +build-backend = "setuptools.build_meta" # ----- Tooling specifics +[tool.setuptools] +py-modules = ["shellai"] + [tool.ruff] # Enable ruff rules to act like flake8 lint.select = [ diff --git a/src/shellai/__init__.py b/src/shellai/__init__.py deleted file mode 100644 index e69de29..0000000