Skip to content

Test pip install of the Python module in CI - #2872

Open
ganeshgore wants to merge 1 commit into
gg_python_sessionfrom
gg_python_pip_ci
Open

ganeshgore wants to merge 1 commit into
gg_python_sessionfrom
gg_python_pip_ci

Conversation

@ganeshgore

Copy link
Copy Markdown
Collaborator

Stacked on #2869 (gg_python_session, base of this PR). Review the last commit only.

Summary

Add a CI job, python_pip_install, that builds and installs the Python module the way a user does with pip install . (added in #2869), and uses it from the installed copy.

The job runs on Ubuntu 22.04 with gcc-12, and has the same needs and if as the other build jobs:

  1. Install the build dependencies of the other jobs, plus python3-venv. Set up ccache.
  2. Check out the submodules that the module needs: VTR, and the micro benchmarks (the circuit of the example). Yosys is not needed.
  3. Build the wheel: pip wheel --no-deps -v . -w dist, with ccache first in PATH.
  4. Install the wheel in a second, clean virtual environment, with pytest and jsonschema.
  5. Run session_quickstart.py from outside the source tree, with PYTHONPATH unset, with the worker process and with --in-process.
  6. Run test_smoke, test_session, test_quickstart and test_worker against the installed module. The other test files run against the build tree in python_binding_test.
  7. Upload the wheel as an artifact (7 days), so that it can be tried without building.

Testing

I could not run the job itself before opening the PR. I ran its steps locally, with local paths: the wheel builds (50 s with a warm build directory), installs in a clean virtual environment, the example runs from another directory, and 52 tests pass with only the installed module on the path. The YAML parses.

Not checked yet, and to be read from the first run of this PR:

  • The time of a cold build on a runner and the ccache hit rate. The module builds only the Python target, without Yosys, and should be shorter than linux_build. If it is not, the job can move to the weekly schedule.
  • The package names on the runner, and the CMake 3.22 of Ubuntu 22.04 with scikit-build-core.

Not included

  • No wheel for other platforms (macOS, Windows): the module is built from the source on the machine, and needs its Tcl, zlib and OpenMP libraries.
  • The job does not publish the wheel anywhere.

The job builds the wheel, installs it in a clean virtual environment, runs
the quickstart example from outside the source tree, and runs the tests of
the Python module against the installed module only. The wheel is kept as
an artifact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant