diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index b6599b4..0756df8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,33 @@ /v0.1.6.tar.gz /v0.2.0.tar.gz /v0.3.0.tar.gz +/v0.4.0.tar.gz +/v0.5.1.tar.gz +/v0.6.0.tar.gz +/v1.0.0.tar.gz +/v1.0.1.tar.gz +/v1.0.2.tar.gz +/v1.0.3.tar.gz +/v1.0.4.tar.gz +/v1.1.0.tar.gz +/v1.1.2.tar.gz +/v1.1.3.tar.gz +/v1.2.0.tar.gz +/v1.2.1.tar.gz +/v1.3.0.tar.gz +/v1.4.0.tar.gz +/v1.4.1.tar.gz +/v1.4.2.tar.gz +/v1.4.3.tar.gz +/v1.4.4.tar.gz +/v1.4.5.tar.gz +/v1.4.6.tar.gz +/v1.5.0.tar.gz +/v1.5.1.tar.gz +/v1.5.2.tar.gz +/v1.6.0.tar.gz +/v1.7.0.tar.gz +/v1.8.0.tar.gz +/v1.8.1.tar.gz +/v1.9.0.tar.gz +/v1.10.0.tar.gz diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..5fa17e8 --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,25 @@ +specfile_path: micropipenv.spec +upstream_package_name: micropipenv +upstream_project_url: https://github.com/thoth-station/micropipenv/ +upstream_tag_template: v{version} +downstream_package_name: micropipenv + +jobs: +- job: pull_from_upstream + trigger: release + dist_git_branches: + - fedora-all + actions: + changelog-entry: + - bash -c '[ -n "$PACKIT_RESOLVED_BUGS" ] && echo "Update to ${PACKIT_PROJECT_VERSION} (${PACKIT_RESOLVED_BUGS})" || echo "Update to ${PACKIT_PROJECT_VERSION}"' + commit-message: + - bash -c '[ -n "$PACKIT_RESOLVED_BUGS" ] && echo "Update to ${PACKIT_PROJECT_VERSION} (${PACKIT_RESOLVED_BUGS})" || echo "Update to ${PACKIT_PROJECT_VERSION}"' +- job: koji_build + trigger: commit + allowed_committers: ["lbalhar", "packit"] + dist_git_branches: + - fedora-all +- job: bodhi_update + trigger: commit + dist_git_branches: + - fedora-branched diff --git a/README.packit b/README.packit new file mode 100644 index 0000000..8c905b9 --- /dev/null +++ b/README.packit @@ -0,0 +1,3 @@ +This repository is maintained by packit. +https://packit.dev/ +The file was generated using packit 0.106.0.post1.dev8+g521f1e1d. diff --git a/changelog b/changelog new file mode 100644 index 0000000..1a51a8c --- /dev/null +++ b/changelog @@ -0,0 +1,117 @@ +* Thu Jan 19 2023 Fedora Release Engineering - 1.4.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Wed Jan 11 2023 Lumír Balhar - 1.4.5-1 +- Update to 1.4.5 (rhbz#2159707) + +* Mon Oct 31 2022 Lumír Balhar - 1.4.4-1 +- Update to 1.4.4 +Resolves: rhbz#2138859 + +* Wed Oct 05 2022 Lumír Balhar - 1.4.3-1 +- Update to 1.4.3 +Resolves: rhbz#2131986 + +* Mon Oct 03 2022 Miro Hrončok - 1.4.2-2 +- Remove manual requirement of python3dist(toml), + package and Recommend the [toml] extra instead + +* Tue Aug 02 2022 Lumír Balhar - 1.4.2-1 +- Update to 1.4.2 +Resolves: rhbz#2110900 + +* Tue Jul 26 2022 Lumír Balhar - 1.4.1-1 +- Update to 1.4.1 +Resolves: rhbz#2110900 + +* Thu Jul 21 2022 Fedora Release Engineering - 1.3.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jun 15 2022 Python Maint - 1.3.0-2 +- Rebuilt for Python 3.11 + +* Wed Jun 08 2022 Lumír Balhar - 1.3.0-1 +- Update to 1.3.0 +Resolves: rhbz#2083779 + +* Mon Feb 21 2022 Lumír Balhar - 1.2.1-1 +- Update to 1.2.1 +Resolves: rhbz#2056449 + +* Thu Jan 20 2022 Fedora Release Engineering - 1.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Wed Jan 05 2022 Lumír Balhar - 1.2.0-1 +- Update to 1.2.0 + +* Mon Oct 25 2021 Lumír Balhar - 1.1.3-1 +- Update to 1.1.3 +Resolves: rhbz#2016285 + +* Wed Oct 06 2021 Lumír Balhar - 1.1.2-1 +- Update to 1.1.2 +Resolves: rhbz#2006696 + +* Thu Jul 22 2021 Fedora Release Engineering - 1.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon Jun 21 2021 Lumír Balhar - 1.1.0-1 +- Update to 1.1.0 +Resolves: rhbz#1974255 + +* Fri Jun 04 2021 Python Maint - 1.0.4-2 +- Rebuilt for Python 3.10 + +* Tue May 04 2021 Lumír Balhar - 1.0.4-1 +- Update to 1.0.4 +Resolves: rhbz#1955039 + +* Fri Mar 12 2021 Karolina SUrma - 1.0.3-1 +- Update to 1.0.3 +Resolves: rhbz#1937471 + +* Tue Jan 26 2021 Fedora Release Engineering - 1.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Dec 11 2020 Lumír Balhar - 1.0.2-1 +- Update to 1.0.2 (#1906430) + +* Tue Nov 10 2020 Lumír Balhar - 1.0.1-1 +- Update to 1.0.1 + +* Fri Oct 02 2020 Lumír Balhar - 1.0.0-1 +- Update to 1.0.0 (#1884346) + +* Thu Sep 03 2020 Lumír Balhar - 0.6.0-1 +- Update to 0.6.0 (#1875250) + +* Thu Jul 30 2020 Lumír Balhar - 0.5.1-1 +- Update to 0.5.1 (#1859995) + +* Tue Jul 28 2020 Fedora Release Engineering - 0.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jul 09 2020 Lumír Balhar - 0.4.0-1 +- Update to 0.4.0 (#1854424) + +* Mon Jun 15 2020 Lumír Balhar - 0.3.0-1 +- Update to 0.3.0 (#1846944) + +* Fri Jun 05 2020 Miro Hrončok - 0.2.0-2 +- Correct the license tag (GPLv3+ to LGPLv3+) +- Include the actual LICENSE files in the package + +* Thu Jun 04 2020 Lumír Balhar - 0.2.0-1 +- Update to 0.2.0 (#1838278, #1841641) + +* Tue May 26 2020 Miro Hrončok - 0.1.6-2 +- Rebuilt for Python 3.9 + +* Tue May 05 2020 Lumír Balhar - 0.1.6-1 +- Update to 0.1.6 (#1831328) + +* Tue Apr 07 2020 Lumír Balhar - 0.1.5-1 +- Update to 0.1.5 (#1821807) + +* Thu Mar 12 2020 Lumír Balhar - 0.1.4-1 +- Initial package. diff --git a/micropipenv.spec b/micropipenv.spec index 0e1a6ad..a687b1d 100644 --- a/micropipenv.spec +++ b/micropipenv.spec @@ -1,73 +1,62 @@ +# some test dependencies are unwanted in RHEL +%if 0%{?rhel} +%bcond_with tests +%else +%bcond_without tests +%endif + Name: micropipenv -Version: 0.3.0 -Release: 1%{?dist} +Version: 1.10.0 +Release: %autorelease Summary: A simple wrapper around pip to support Pipenv and Poetry files -License: LGPLv3+ +License: LGPL-3.0-or-later URL: https://github.com/thoth-station/%{name} Source0: %{url}/archive/v%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel -BuildRequires: python3dist(pip) -BuildRequires: python3dist(setuptools) -BuildRequires: python3dist(toml) -# For testing -BuildRequires: python3dist(flexmock) -BuildRequires: python3dist(pytest) -BuildRequires: python3dist(pytest-timeout) -%{?python_provide:%python_provide python3-%{name}} +%py_provides python3-%{name} -Requires: python3dist(pip) -Requires: python3dist(setuptools) -Requires: python3dist(toml) +Recommends: micropipenv+toml %description A lightweight wrapper for pip to support Pipenv and Poetry lock files or converting them to pip-tools compatible output. +%pyproject_extras_subpkg -n %{name} toml + %prep -%autosetup -n %{name}-%{version} +%autosetup # Remove shebang line from the module sed -i '1{\@^#!/usr/bin/env python@d}' %{name}.py +# Remove virtualenv requirement from tox.ini +sed -i '/requires = virtualenv/d' tox.ini +# Do not install wheel in testing venvs +sed -i 's/[^ ]*wheel==0.45.1.*/pass/' tests/conftest.py + +%generate_buildrequires +%pyproject_buildrequires -r %{?with_tests:-t} -x toml %build -%py3_build +%pyproject_wheel %install -%py3_install +%pyproject_install +%pyproject_save_files %{name} %check -# test_install requires pytest-venv not available in Fedora -%{python3} -m pytest tests -k "not test_install" +%if %{with tests} +# skipped tests requires internet or checks pip version +%pytest -m "not online" -k "not test_check_pip_version and not test_install_invalid_toml_file" +%else +%pyproject_check_import +%endif -%files +%files -f %pyproject_files %doc README.rst -%license LICENSE* %{_bindir}/micropipenv -%pycached %{python3_sitelib}/%{name}.py -%{python3_sitelib}/%{name}-%{version}-py*.egg-info/ %changelog -* Mon Jun 15 2020 Lumír Balhar - 0.3.0-1 -- Update to 0.3.0 (#1846944) - -* Fri Jun 05 2020 Miro Hrončok - 0.2.0-2 -- Correct the license tag (GPLv3+ to LGPLv3+) -- Include the actual LICENSE files in the package - -* Thu Jun 04 2020 Lumír Balhar - 0.2.0-1 -- Update to 0.2.0 (#1838278, #1841641) - -* Tue May 26 2020 Miro Hrončok - 0.1.6-2 -- Rebuilt for Python 3.9 - -* Tue May 05 2020 Lumír Balhar - 0.1.6-1 -- Update to 0.1.6 (#1831328) - -* Tue Apr 07 2020 Lumír Balhar - 0.1.5-1 -- Update to 0.1.5 (#1821807) - -* Thu Mar 12 2020 Lumír Balhar - 0.1.4-1 -- Initial package. +%autochangelog diff --git a/plan.fmf b/plan.fmf new file mode 100644 index 0000000..a418c92 --- /dev/null +++ b/plan.fmf @@ -0,0 +1,14 @@ +discover: + how: fmf + dist-git-source: true +execute: + how: tmt +prepare: + - name: install git-core + how: install + package: + - git-core + - micropipenv + - name: clone upstream test data + how: shell + script: git clone https://github.com/thoth-station/micropipenv.git /tmp/micropipenv diff --git a/sources b/sources index 7e9acfd..3b743a0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v0.3.0.tar.gz) = a26d6fd489ac316d16c2f1e92f31aa546abeda850ba64eb5eddf437d50fd2aab3367b702e6994130d36c86bca0a333aecc6dc63dc2d77502177ee4a8e8edb4e4 +SHA512 (v1.10.0.tar.gz) = 8508777d2cc04f3aa9faf834a75154d5d3aa8e24ca5551febce4c40c78d32b4cae0753bdf26fc6118b2033852bda4370ef869949389e745991a46b9d44981cf5 diff --git a/tests/example/pip-tools.fmf b/tests/example/pip-tools.fmf new file mode 100644 index 0000000..e761897 --- /dev/null +++ b/tests/example/pip-tools.fmf @@ -0,0 +1,2 @@ +summary: Install from pip-tools +test: ./test_install.sh pip-tools diff --git a/tests/example/pipfile.fmf b/tests/example/pipfile.fmf new file mode 100644 index 0000000..556a0f1 --- /dev/null +++ b/tests/example/pipfile.fmf @@ -0,0 +1,2 @@ +summary: Install from Pipfile +test: ./test_install.sh pipenv diff --git a/tests/example/poetry.fmf b/tests/example/poetry.fmf new file mode 100644 index 0000000..03226a0 --- /dev/null +++ b/tests/example/poetry.fmf @@ -0,0 +1,2 @@ +summary: Install from poetry +test: ./test_install.sh poetry diff --git a/tests/example/requirements.fmf b/tests/example/requirements.fmf new file mode 100644 index 0000000..c20d890 --- /dev/null +++ b/tests/example/requirements.fmf @@ -0,0 +1,2 @@ +summary: Install from requirements +test: ./test_install.sh requirements diff --git a/tests/example/test_install.sh b/tests/example/test_install.sh new file mode 100755 index 0000000..03acf5e --- /dev/null +++ b/tests/example/test_install.sh @@ -0,0 +1,8 @@ +pushd /tmp/micropipenv/tests/data/install/$1/ +python3 -m venv venv +source venv/bin/activate +micropipenv install +pip3 list +deactivate +rm -rf venv +popd diff --git a/tests/smoke.fmf b/tests/smoke.fmf new file mode 100644 index 0000000..25498bb --- /dev/null +++ b/tests/smoke.fmf @@ -0,0 +1,2 @@ +test: bash ./smoke.sh +framework: shell diff --git a/tests/smoke.sh b/tests/smoke.sh new file mode 100644 index 0000000..fee1bf2 --- /dev/null +++ b/tests/smoke.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -ex + +username="test_$$" +id "$username" && userdel -rf "$username" + +useradd "$username" +su -l -c "echo simple-manylinux-demo > requirements.txt" "$username" +su -l -c "micropipenv install -- --user" "$username" +su -l -c "python3 -c 'from dummyextension.extension import hello; assert hello() == \"Hello from Python extension!\"'" "$username" + +userdel -rf "$username" diff --git a/tests/upstream.fmf b/tests/upstream.fmf new file mode 100644 index 0000000..d350ffc --- /dev/null +++ b/tests/upstream.fmf @@ -0,0 +1,13 @@ +summary: upstream testsuite +require: + - python3-devel + - python3-test + - python3-pip + - python3-pytest + - python3-pytest-venv + # flexmock installed from PyPI, not available in RHEL +test: | + pip install flexmock==0.12.1 && + cd $(dirname $TMT_SOURCE_DIR/micropipenv-*/tests) && + pytest -v +duration: 5m