Skip to main content
Ruff

py-obs is a simple asynchronous python API wrapper for the Open Build Service.

Testing

The following commands will launch a local OBS instance using docker compose:

$ ./start-mini-obs.sh
$ ./configure-mini-obs.sh

Afterwards, you can run the integration tests agains the local instance via:

$ poetry run pytest -vv

Recording interactions with build.opensuse.org

It can be undesirable to setup packages on the local test instance. We use pytest-recording to record the HTTP requests against OBS for faster unit tests and for not requiring an account for testing.

To create a test which runs against OBS, create a test function with the following markers:

@pytest.mark.vcr(filter_headers=["authorization", "openSUSE_session"])
@pytest.mark.asyncio
async def test_something_against_obs(osc_from_env: OSC_FROM_ENV_T) -> None:
    async for osc in osc_from_env:
        # now we can do something with osc
        pass

The filter_headers is crucial here, as otherwise you’ll record your password & session.

To record the interaction, run the tests once as follows:

$ OSC_USER=$my_obs_account OSC_PASSWORD=$my_obs_password \
      poetry run pytest -vv -k something_against_obs

Replace something_against_obs with the name of your test function (minus the leading test_) or some other filter, to only run this one test function.

A new cassette file should show up in tests/cassettes. Do not forget to commit it into git.

Release files for py-obs 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-obs 0.0.2
File Size Uploaded
py_obs-0.0.2.tar.gz 20.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-obs 0.0.2
File Interpreter ABI Platform
py_obs-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 46.2 kB

Release files / py_obs-0.0.2.tar.gz

Download URL py_obs-0.0.2.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
976367563e7f4886c8a87c56369ae2703a50e987848b8ca89b9506c21dc76f60
BLAKE2b-256 checksum
How to use checksums
4219d09e57eb2e1e9ce7c2188f22a44a621cef59bf424e241b5db3be4007c54a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 25, 2025.

Transparency log

Release files / py_obs-0.0.2-py3-none-any.whl

Download URL py_obs-0.0.2-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
909806f788725e7a44579f8164f953f44124f1d313e173a522dc27da562eb194
BLAKE2b-256 checksum
How to use checksums
9df26866e4a7cd49f54f32027e81f5ffddea3bf4a2ad6c43c5cccf1ac061b9d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 25, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page