Asynchronous API wrapper for the Open Build Service
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file py_obs-0.0.2.tar.gz
.
File metadata
- Download URL: py_obs-0.0.2.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 976367563e7f4886c8a87c56369ae2703a50e987848b8ca89b9506c21dc76f60 |
|
MD5 | 4544fe2a1856bc3bcc24b65dbfb27bd0 |
|
BLAKE2b-256 | 4219d09e57eb2e1e9ce7c2188f22a44a621cef59bf424e241b5db3be4007c54a |
Provenance
The following attestation bundles were made for py_obs-0.0.2.tar.gz
:
Publisher:
release.yml
on dcermak/py-obs
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
py_obs-0.0.2.tar.gz
- Subject digest:
976367563e7f4886c8a87c56369ae2703a50e987848b8ca89b9506c21dc76f60
- Sigstore transparency entry: 174141993
- Sigstore integration time:
- Permalink:
dcermak/py-obs@8d694c57498aae56d9b64592872066f67f1b9b1f
- Branch / Tag:
refs/tags/0.0.2
- Owner: https://github.com/dcermak
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
release.yml@8d694c57498aae56d9b64592872066f67f1b9b1f
- Trigger Event:
push
- Statement type:
File details
Details for the file py_obs-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: py_obs-0.0.2-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 909806f788725e7a44579f8164f953f44124f1d313e173a522dc27da562eb194 |
|
MD5 | c24f7b5ecea1a51ecb836e722ea79d17 |
|
BLAKE2b-256 | 9df26866e4a7cd49f54f32027e81f5ffddea3bf4a2ad6c43c5cccf1ac061b9d2 |
Provenance
The following attestation bundles were made for py_obs-0.0.2-py3-none-any.whl
:
Publisher:
release.yml
on dcermak/py-obs
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
py_obs-0.0.2-py3-none-any.whl
- Subject digest:
909806f788725e7a44579f8164f953f44124f1d313e173a522dc27da562eb194
- Sigstore transparency entry: 174141995
- Sigstore integration time:
- Permalink:
dcermak/py-obs@8d694c57498aae56d9b64592872066f67f1b9b1f
- Branch / Tag:
refs/tags/0.0.2
- Owner: https://github.com/dcermak
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
release.yml@8d694c57498aae56d9b64592872066f67f1b9b1f
- Trigger Event:
push
- Statement type: