Self-contained library to deal with metadata in Enthought-specific egg and runtime archives
Project description
.. image:: https://travis-ci.com/enthought/okonomiyaki.svg?branch=master
:target: https://travis-ci.com/enthought/okonomiyaki
Okonomiyaki is an experimental library aimed at consolidating a lot of our
low-level code used for Enthought's eggs.
The library contains code for the following:
* producing EDM and enpkg-compatible egg from a tree + metadata
* object models for eggs metadata, as well as versions and platform
representations
It works on both python 2 and 3, and pypy. It is expected to work on pretty
much any compliant python implementation.
Examples
========
Version parsing
---------------
To parse versions::
from okonomiyaki.versions import EnpkgVersion
# Every Version class has a from_string constructor
v1 = EnpkgVersion.from_string("1.3.3-1")
v2 = EnpkgVersion.from_string("1.3.2-3")
assert v1 > v2
Version instances are designed to be immutable, and to be used as keys in
dictionaries.
Platform parsing
----------------
To parse epd platform strings (``rh5-64``, ``rh6_x86_64``, etc.) consistently::
from okonomiyaki.platforms import EPDPlatform
# Internal representation is normalized.
rh5_new_name = EPDPlatform.from_string("rh5-x86_64")
rh5_old_name = EPDPlatform.from_string("rh5-64")
assert rh5_old_name == rh5_new_name
As for Version instances, ``EPDPlatform`` instances are designed to be
immutable and to be used as keys in dictionaries.
Egg metadata
------------
To parse Enthought eggs::
from okonomiyaki.file_formats import EggMetadata
# Only works for Enthought eggs
metadata = EggMetadata.from_egg("numpy-1.10.1-1.egg")
print(metadata.metadata_version)
print(metadata.name)
print(metadata.version)
This will take care of a lot of low-level, legacy details you don't want to
know about.
2023-06-29 1.4.0
--------------------
Enhancements:
* Add cp311 dummy runtimes (#349)
* Add cp311 dummy eggs (#453)
* Update the code to guess a Platform instance from the running system (#448)
- Added a NameKind value for Rocky Linux
- Debian and RHEL compatible systems are now supported by the "uknown" NameKind
- Add support for the RH8 platform
* Update the PythonImplementation instance to support cp311 (#451)
* Update okonomiyaki code to not use the deprecated LegacyEPDPlatform instance (#452)
Maintenance:
* Remove old Jenkins CI build setup (#440)
* Update the test matrix on github actions and remove testing for Python 2.7 (#441, #447)
* Move most of the package configuration into the setup.cfg (#450)
Big fixes:
* Fix the behaviour of the pep245 module and the way it is tested (#441, #447)
* Fix the repr output for PEP440Version and RuntimeVersion (#435, #436)
* Fix error message for unsupported platform combinations (#433)
* Fix permissions in the dummy egg archives (#430)
2021-07-01 1.3.2
--------------------
Big fixes:
* Fix relative imports (#426)
* Fix compute_abi_tag to support Python 3.8 (#424)
2021-06-29 1.3.1
--------------------
Big fixes:
* Update dummy eggs to hold the correct abi tag for Python 3.8 (#413)
* Pass the runtime version to the from_epd_string constructor (#414)
* Fix _guess_abi_tag and _guess_abi_from_python to support python 3.8 (#418)
2021-03-21 1.3.0
--------------------
Enhancements:
* Add cp38 dummy runtimes (#387)
* Add cp38 dummy eggs (#395, #398)
* Update default abi functions to support python 3.8 (#390)
Maintenance:
* Enable GitHub actions (#384)
* Fix build badge to point to travis-ci.com (#376)
* Fix path to the okonomiyaki test build project (#379)
* Update script that verifies okonomiyaki can read eds eggs (#396)
Big fixes:
* Add rh6 and rh7 dummy eggs to setup.py (#369)
* EPDPlatform.pep425_tag will always return 10.6 for macos platforms (#374, #387)
* Fix older dummy windows runtime archives to work with recent EDM (#391, #397)
* EPDPlatform.from_string will always return fixed release versions (#375, #387)
2019-11-08 1.2.0
--------------------
Enhancements:
* Run tests against Centos 7. (#359)
Maintenance:
* Run Travis CI on maintenance and tagged branches. (#352)
* Only test branch builds on Appveyor for master and maintenance branches. (#364)
Big fixes:
* Add the license to the manifest. (#354)
* Fix platform detection on Centos 7. (#161)
* Fix error when '$' is in the Python runtime prefix. (#309)
2019-09-20 1.1.1
--------------------
Big fixes:
* Fix name of the 2.7.10 dummy runtime for rh6. (#341)
2019-09-19 1.1.0
--------------------
Enhancements:
* Add dummy test runtimes for python 3.6.5. (#327)
* Add dummy test runtimes for rh7. (#331)
* Add dummy test runtimes for rh6. (#330)
* Add dummy test eggs for rh7. (#329)
* Add dummy test eggs for rh6. (#328)
2019-03-15 1.0.0
--------------------
Enhancements:
* Add ability to parse setuptools eggs and wheels with metadata version 2.1 (#312)
Bug fixes:
* Improve error message when hyphens are used in spec requirement string (#319)
* Fix CI errors with jasonschema and attrs incompatibility (#318)
* Fix Travis CI flake8 errors (#316)
2018-03-12 0.17.4
--------------------
Bug fixes:
* fix test data dummy runtime for python 2.7.9 that contained osx system files. (#304)
* fix test data dummy windows runtimes fix_scripts to support python 2 and python 3. (#303)
2017-12-13 0.17.3
--------------------
Enhancements:
* WheelInfo provides properties for the 'scripts' and 'headers'
prefix scheme. (#298)
2017-07-20 0.17.2
--------------------
bug fixes:
* skip expected failure test_simple_from_running_python when running
on osx under python 2.7.x. (#295)
2017-07-19 0.17.1
--------------------
Enhancements:
* streamline travis ci testing. (#286)
* run tests on appveyor and python 3. (#288)
bug fixes:
* fix Runtime.executable value for Python 3 on windows. (#288)
* fix compute_abi_tag/compute_python_tag/compute_platform_tag so that
they can be used in a frozen app. (#284)
2017-07-03 0.17.0
--------------------
Enhancements:
* compute default ABI for ironpython/jython. (#225)
* add support for CPython 3.6 (#229)
* add support for `PKG-INFO` format 1.2 and 2.0 (#261, #271)
* fix support for attrs >= 17.x
* PackageInfo.from_path may parse PKG-INFO metadata from both wheels and eggs. (#274)
* add WheelInfo class for wheel pep425 tags parsing. (#275)
* add compute_abi_tag/compute_python_tag/compute_platform_tag functions to
compute PEP 425 tags from arbitrary python executables (#278)
* add some basic examples in the README. (#279)
* add commonly used wheel prefixes to WheelInfo. (#280)
bug fixes:
* fix author_* entries in setup.py. (#235)
* test runtimes should include pythonw.exe (#238)
* fix applies("32")/applies("64") (#244)
* fix permissions for egg metadata written through writestr. (#249)
* fix error handling for platform strings with 'remains'. (#253)
* fix invalid trove classifier in setup.py. (#258)
* mark classes we need hashable as immutable. (#266)
* add (long) description into setup.py. (#272)
2016-06-29 0.16.0
--------------------
This release focused on speeding up EggMetadata, and adding json serialization
for EDM.
Enhancements:
* update dependency on attr >= 16.0.0, which contains some speedups for
validators (#220)
* lazily parse PKG-INFO in EggMedata (#216)
* test runtimes's dummy pythons output the right string and are of the right
bitness (#215)
* test runtimes now contains symlinks on Unix (#214)
* json serialization for EggMetadata (#213)
* expose Kind enums to okonomiyaki.runtimes (#204)
* speedup EggMetadata.from_egg (#203)
* EPDPlatform.from_epd_string is deprecated in favor of
EPDPlatform.from_string(#199)
* EggMetadata.from_egg does not re-open a zipfile 3 times (#195)
Bugs:
* fix flake8 violations (#218)
* remove spurious dependency on stevedore (#208)
* missing enum34 dependency (#196)
2016-04-27 0.15.0:
--------------------
Enhancements:
* add `platform_abi` field to `EggMetadata`
Bug fixes:
* raise the correct exception for invalid egg metadata (#156)
* raise the correct exception for missing metadata in runtimes (#165)
Internal changes:
* enum34 is used instead of traitlets (#55)
* traitlets is not used anymore (#56, #115, #145)
2015-12-09 0.14.0:
--------------------
Enhancements:
* Reject incompatible metadata_version in egg metadata, and add API to easily
tweak the output's metadata_version (#150)
* `default_abi` now works for alternative implementations (#149).
* Exception hierarchy for invalid metadata has been improved for
finer-grained error messages (#151)
Backward incompatible changes:
* `default_abi` function now takes 3 arguments (#149).
Bug fixes:
* update python_tag blacklist to handle wrong metadata (#146)
2015-10-02 0.13.0:
--------------------
Enhancements:
* `abi` attribute for runtime (#134)
* `metadata_version` attribute for runtime added (#143)
Backward incompatible changes:
* `language` attribute from runtime removed (#134)
* `metadata_version_info` attribute from EggMetadata removed (#143)
Bug fixes:
* update PKG-INFO blacklist to handle every pypi egg (#141)
* update platform blacklist to handle wrong metadata for windows eggs w/ C
extensions and no platform set up (#142)
(#136).
* fix round-tripping for PEP386 versions with post part without a dev part
(#136).
2015-09-28 0.12.0:
--------------------
Improvements:
* blacklist mechanism for invalid python tag of existing eggs (#127)
* accept filtre function in egg builders now take two arguments to allow
filtering on the full content of the archive (#128)
2015-09-14 0.11.0:
--------------------
Improvements:
* SemanticVersion class added
* MetadataVersion class added to easily manipulate metadata versions.
* PEP440Version class added.
* RuntimeVersion class added to model edm runtime versions
* IRuntimeMetadata.factory_from_path class function to parse and validate
runtime packages.
* __str__ is now implemented for EPDPlatform. The implementation support
EPDPlatform.from_epd_string(str(epd_platform)) == epd_platform (#117)
2015-00-01 0.10.0:
--------------------
Improvements:
* EnpkgVersion.from_string now handles versions of the form `1.3.0`, with the
build number being implicitly 0.
* EggMetadata.from_egg now handles eggs built for RedHat Enterprise
Linux 3 (#88).
* Fix decoding errors when parsing PKG-INFO (#86)
* Fix parsing of spec/depend for RedHat 3 eggs (#88)
* Special case invalid requirement 'numpy-1.8.0'
Internals:
* Remove dependency on six
* Add support for both '-' and '_' as separators between os and arch in
platform names for EPDPlatform, i.e. both from_epd_string("rh5-x86_64") and
from_epd_string("rh5_x86_64") work (#83).
* Black list mechanism to fix invalid PKG-INFO
* Black list mechanism to handle platform-specific, any-arch eggs
* Add special 'private' API for brood to bypass checksum computation in
EggMetadata and PackageInfo
2015-07-06 0.9.0:
-------------------
Improvements:
* SetuptoolsEggMetadata now can guess ABI for legacy cases. (#74)
* use PythonImplementation instances instead of strings to store python tag
(#75).
* add okonomiyaki.__version_info__ for easy version comparison (#76).
2015-06-30 0.8.0:
-------------------
New features:
* New EggRewriter class to create Enthought eggs from setuptools eggs.
Improvements:
* add EPDPlatform.from_running_python ctor (#62)
* reject unsupported metadata version in PackageInfo (#63)
* add support for 'py2' python tag (#64)
* add support for python 3 in SetuptoolsEggMetadata (#70)
Bug fixes:
* handle Enthought eggs without PKG-INFO in EggMetadata (#65)
* fix unicode handling of PKG-INFO and EGG-INFO/spec/summary (#72)
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
okonomiyaki-1.4.0.tar.gz
(3.0 MB
view details)
Built Distribution
File details
Details for the file okonomiyaki-1.4.0.tar.gz
.
File metadata
- Download URL: okonomiyaki-1.4.0.tar.gz
- Upload date:
- Size: 3.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.5.0.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 508008004a12e09f565d8b4e4145bd7500787fdd6810d898fdc8e5c61a3f41e5 |
|
MD5 | cdfccfd94d4d68fbd025678699e8b176 |
|
BLAKE2b-256 | feb6d935853ab77612a2056ecea6227ffc6f699fba86e5860e4c163382b3e367 |
File details
Details for the file okonomiyaki-1.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: okonomiyaki-1.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.1 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.5.0.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 174af185f866fc42fdb58b2d6c7107d870f795e3f404b9c6278f8e62f87f0f83 |
|
MD5 | 0d5f5bff613918121fbcf5b195f0eecb |
|
BLAKE2b-256 | dc7f11e87614ab420f123ab987d83705df299677135bb6ee2f304967348d860e |