diff --git a/.distro/plans/examples.fmf b/.distro/plans/examples.fmf index 96d0d5528..65a807683 100644 --- a/.distro/plans/examples.fmf +++ b/.distro/plans/examples.fmf @@ -1,7 +1,5 @@ summary: Documentation examples discover+: - how: fmf filter: "tag: examples" - path: docs execute: how: tmt diff --git a/.distro/plans/main.fmf b/.distro/plans/main.fmf index a031810f3..f140a10f5 100644 --- a/.distro/plans/main.fmf +++ b/.distro/plans/main.fmf @@ -1,7 +1,10 @@ +discover: + how: fmf + path: . + adjust+: # Cannot use initiator: fedora-ci reliably yet when: initiator is not defined or initiator != packit discover+: - how: fmf dist-git-source: true dist-git-extract: scikit_build_core-*/ diff --git a/docs/.fmf/version b/.fmf/version similarity index 100% rename from docs/.fmf/version rename to .fmf/version diff --git a/.packit.yaml b/.packit.yaml index 1ed320c31..cc7f7bbe8 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -27,27 +27,39 @@ _: - &build-in-scikit-build <<: *build-in-packit owner: "@scikit-build" - - &tests + - &tests-downstream job: tests fmf_path: .distro + identifier: downstream + - &tests-upstream + job: tests + skip_build: true + identifier: upstream + targets: + - fedora-development jobs: # Upstream jobs - <<: *build-in-scikit-build trigger: release project: release - - <<: *tests + - <<: *tests-downstream trigger: release - <<: *build-in-scikit-build trigger: commit branch: main project: nightly - - <<: *tests + - <<: *tests-downstream + trigger: commit + branch: main + - <<: *tests-upstream trigger: commit branch: main - <<: *build-in-packit trigger: pull_request - - <<: *tests + - <<: *tests-downstream + trigger: pull_request + - <<: *tests-upstream trigger: pull_request # Downstream jobs - job: propose_downstream diff --git a/docs/examples/downstream/main.fmf b/docs/examples/downstream/main.fmf index 21835ae54..e09851977 100644 --- a/docs/examples/downstream/main.fmf +++ b/docs/examples/downstream/main.fmf @@ -1,3 +1,4 @@ +summary: Downstream example environment: HAS_PYTEST: true require+: diff --git a/docs/examples/downstream/nanobind_example/main.fmf b/docs/examples/downstream/nanobind_example/main.fmf index 7365fa7f2..68ad74784 100644 --- a/docs/examples/downstream/nanobind_example/main.fmf +++ b/docs/examples/downstream/nanobind_example/main.fmf @@ -1,6 +1,8 @@ -summary: Nanobind downstream example +summary+: " (nanobind)" +require+: + # TODO: These don't make sense to be packaged in a different package + - python3-nanobind-devel adjust: + when: distro < fedora-41 or distro == centos-stream enabled: false - because: Nanobind is not yet packaged on Fedora -#require+: -# - python3dist(nanobind) + because: They have not packaged nanobind there diff --git a/docs/examples/downstream/pybind11_example/main.fmf b/docs/examples/downstream/pybind11_example/main.fmf index f0732e320..328d85f50 100644 --- a/docs/examples/downstream/pybind11_example/main.fmf +++ b/docs/examples/downstream/pybind11_example/main.fmf @@ -1,4 +1,4 @@ -summary: Pybind downstream example +summary+: " (pybind11)" require+: - gcc-c++ - python3dist(pybind11) diff --git a/docs/examples/getting_started/abi3/main.fmf b/docs/examples/getting_started/abi3/main.fmf index 70d87b706..e77ff85c7 100644 --- a/docs/examples/getting_started/abi3/main.fmf +++ b/docs/examples/getting_started/abi3/main.fmf @@ -1 +1 @@ -summary: Abi3 example project +summary+: " (Abi3)" diff --git a/docs/examples/getting_started/c/main.fmf b/docs/examples/getting_started/c/main.fmf index 70765c17b..0ace824cd 100644 --- a/docs/examples/getting_started/c/main.fmf +++ b/docs/examples/getting_started/c/main.fmf @@ -1 +1 @@ -summary: C example project +summary+: " (C)" diff --git a/docs/examples/getting_started/cython/main.fmf b/docs/examples/getting_started/cython/main.fmf index 4c81569be..e3e577fc1 100644 --- a/docs/examples/getting_started/cython/main.fmf +++ b/docs/examples/getting_started/cython/main.fmf @@ -1,3 +1,3 @@ -summary: Cython example project +summary+: " (cython)" require+: - python3dist(cython) diff --git a/docs/examples/getting_started/fortran/main.fmf b/docs/examples/getting_started/fortran/main.fmf index 0bf94bfcc..7d1c8fcda 100644 --- a/docs/examples/getting_started/fortran/main.fmf +++ b/docs/examples/getting_started/fortran/main.fmf @@ -1,4 +1,4 @@ -summary: F2PY example project +summary+: " (F2PY)" require+: - gcc-gfortran - python3dist(numpy) diff --git a/docs/examples/getting_started/main.fmf b/docs/examples/getting_started/main.fmf new file mode 100644 index 000000000..340ab0bd9 --- /dev/null +++ b/docs/examples/getting_started/main.fmf @@ -0,0 +1 @@ +summary: Getting started diff --git a/docs/examples/getting_started/nanobind/main.fmf b/docs/examples/getting_started/nanobind/main.fmf index 9f8391d44..68ad74784 100644 --- a/docs/examples/getting_started/nanobind/main.fmf +++ b/docs/examples/getting_started/nanobind/main.fmf @@ -1,6 +1,8 @@ -summary: Nanobind example project +summary+: " (nanobind)" +require+: + # TODO: These don't make sense to be packaged in a different package + - python3-nanobind-devel adjust: + when: distro < fedora-41 or distro == centos-stream enabled: false - because: Nanobind is not yet packaged on Fedora -#require+: -# - python3dist(nanobind) + because: They have not packaged nanobind there diff --git a/docs/examples/getting_started/pybind11/main.fmf b/docs/examples/getting_started/pybind11/main.fmf index 2308fa3f4..328d85f50 100644 --- a/docs/examples/getting_started/pybind11/main.fmf +++ b/docs/examples/getting_started/pybind11/main.fmf @@ -1,4 +1,4 @@ -summary: Pybind example project +summary+: " (pybind11)" require+: - gcc-c++ - python3dist(pybind11) diff --git a/docs/examples/getting_started/swig/main.fmf b/docs/examples/getting_started/swig/main.fmf index ba84f71aa..0da4f7355 100644 --- a/docs/examples/getting_started/swig/main.fmf +++ b/docs/examples/getting_started/swig/main.fmf @@ -1,3 +1,3 @@ -summary: Swig example project +summary+: " (Swig)" require+: - swig diff --git a/docs/examples/main.fmf b/docs/examples/main.fmf index fabeff773..06a8f9006 100644 --- a/docs/examples/main.fmf +++ b/docs/examples/main.fmf @@ -8,4 +8,4 @@ require: - tree framework: beakerlib path: / -test: ./examples/test.sh +test: ./docs/examples/test.sh diff --git a/docs/examples/test.sh b/docs/examples/test.sh index afcee1617..c022cf83a 100755 --- a/docs/examples/test.sh +++ b/docs/examples/test.sh @@ -8,7 +8,7 @@ rlJournalStart rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" rlRun "rsync -r .$TMT_TEST_NAME/ $tmp" 0 "Copy example project" if [ "${HAS_PYTEST}" != True ]; then - rlRun "rsync -r ./examples/getting_started/test.py $tmp" 0 "Copy test.py file" + rlRun "rsync -r ./docs/examples/getting_started/test.py $tmp" 0 "Copy test.py file" fi rlRun "pushd $tmp" rlRun "tree" 0 "Show directory tree" @@ -18,7 +18,7 @@ rlJournalStart rlPhaseEnd rlPhaseStartTest - rlRun "pip install . -v --config-settings=build.verbose=true --no-index --no-build-isolation" 0 "Build the python project" + rlRun "pip install . -v --no-index --no-build-isolation" 0 "Build the python project" if [ "${HAS_PYTEST}" == True ]; then rlRun "python3 -m pytest" 0 "Run built-in pytest" else diff --git a/pyproject.toml b/pyproject.toml index 3e153f0d0..dcd667322 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -139,6 +139,7 @@ filterwarnings = [ "error", "ignore:Config variable '.*' is unset, Python ABI tag may be incorrect:RuntimeWarning", "default:pkg_resources is deprecated as an API:DeprecationWarning:wheel", # Caused by wheel<0.41 in tests + "default:The 'wheel' package is no longer the canonical location:DeprecationWarning", # Caused by wheel also "default:onerror argument is deprecated, use onexc instead:DeprecationWarning:wheel", # Caused by wheel<0.41 & Python 3.12 "default:The distutils package is deprecated and slated for removal:DeprecationWarning", # Caused by setuptools sometimes "default:The distutils.sysconfig module is deprecated, use sysconfig instead:DeprecationWarning", # Caused by setuptools sometimes diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 000000000..ebdc0714d --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,17 @@ +/pytest: + summary: Run pytest tests + tag: [ pytest ] + # TODO: filter only for network marked tests + /all: + summary: All pytest + # TODO: Find a better way to deal with lack of git data + path: / + test: | + # Fake a git archive + cat << EOF > .git_archival.txt + node: 47431d4eefbac9c3a7c49e62c73e624b932023eb + node-date: 2025-02-27T16:18:39-05:00 + describe-name: v0.11.0 + EOF + # Actually run pytest + python3 -m pytest diff --git a/tests/plans.fmf b/tests/plans.fmf new file mode 100644 index 000000000..6235878a1 --- /dev/null +++ b/tests/plans.fmf @@ -0,0 +1,35 @@ +/: + inherit: false + +/pytest: + summary: Run all pytest + prepare: + - name: Install test packages + how: install + package: + # Pip install everything + - python3-pip + # Test everything we got + - gcc-c++ + - gfortran + - cmake + - ninja-build + # For FindPython + - python3-devel + # There are tests that use FetchContent git + - git + - name: Prepare environment + how: shell + script: | + # Fake a git archive + cat << EOF > .git_archival.txt + node: 47431d4eefbac9c3a7c49e62c73e624b932023eb + node-date: 2025-02-27T16:18:39-05:00 + describe-name: v0.11.0 + EOF + pip install --user .[test] + discover: + how: fmf + filter: "tag: pytest" + execute: + how: tmt