python-takauma
Python-moduulien tiedostoversiointi
Luokkakohtainen versionmuodostus:
Oletetaan, että paketti python-foobar on asennettu, ja sen versionumero on 1.2.3.
Olkoon tiedosto spam.py seuraavansisältöinen:
# python-foobar/foobar/spam.py
from takauma import Versio
class Spam:
__versio__ = Versio()
print(Foo.__versio__)
Tällöin komento python -m foobar.spam tulostaa Version('1.2.3').
Aiemmat luokkaversiot:
Oletetaan paketin asennus samoin kuin edellä.
Olkoon tiedosto eggs.py seuraavansisältöinen:
# python-foobar/foobar/eggs.py
# versiointi: *
from takauma import etsi_versiot
class Eggs:
luku = 42
Eggs._aiemmat_versiot = etsi_versiot(Eggs)
for versio in '1.2.4', '1.2.3', '1.2.2', '1.2.1', '1':
try: print(Eggs._aiemmat_versiot[versio].luku)
except Exception as exc: print(exc)
Oletetaan lisäksi, että levyllä on jäljellä aiempi versio samasta tiedostosta:
# python-foobar/foobar/eggs-1.2.1.py
class Eggs:
luku = 24
Silloin komento python -m foobar.eggs tulostaa seuraavasti:
42
42
24
24
KeyError: '1'
Aiempien versioiden luonti:
Aiempi tiedostoversio tunnistetaan tiedostonimen mukaan silloin, kun se on muotoa <moduuli>-<versio>.py, missä <moduuli>.py on viimeisin, ajossa oleva tiedostoversio.
Git-versiointi (https://pypi.org/project/git-versiointi/) tallentaa aiemmat versiot automaattisesti git-muutostietojen mukaan erityisen versiointimerkinnän perusteella: ks. edellä eggs.py-tiedostossa rivi 2.
Versiointimääritys (# versiointi: x) aiheuttaa sen, että kopiot tiedostosta tallennetaan git-versiohistorian mukaisesti git-revisioon x asti (poissulkevasti), tai historian alkuun saakka (*).
Huomaa, että aiempien tiedostoversioiden muodostus versiomäärityksen perusteella tapahtuu pip-asennuksen build_py-vaiheessa, eikä niitä siis synny automaattisesti kehitystilassa olevalle paketin sisälle. Sen sijaan aiemman version testaus onnistuu vaikkapa seuraavantyyppisen komennon avulla:
git -C python-foobar show HEAD~2:foobar/eggs.py > python-foobar/foobar/eggs-1.2.1.py
Metadata
Release files for python-takauma 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python_takauma-0.6.3.tar.gz | 7.2 kB | Without provenance | Details for python_takauma-0.6.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_takauma-0.6.3-py3-none-any.whl | Python 3 | none | any | Details for python_takauma-0.6.3-py3-none-any.whl |
Total release size: 15.8 kB
Release files / python_takauma-0.6.3.tar.gz
| Download URL | python_takauma-0.6.3.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4d6b53978270416b934d5f1b4f6156cc56b96da15c4da8c0592a19f7837a8e3
|
|
BLAKE2b-256 checksum How to use checksums |
c160c8b2dcc00bbbfddf7005156533cbe81418778e5242e205969ea90271e500
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.0
|
Release files / python_takauma-0.6.3-py3-none-any.whl
| Download URL | python_takauma-0.6.3-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c0c8529988cdecf4ee918c232d677e6e877242d38a450d28e5ef81674e7b828
|
|
BLAKE2b-256 checksum How to use checksums |
d9caab91617ced7089fa90318cd910bb0a90af9bbe8296ca4ed7bc27a315edfd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.0
|
Security for python-takauma 0.6.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.