- Trailing whitespaces at the end of specfile sections are now ignored during parsing. (#531)
- Fixed issues related to introduced sanitization (#523, #524, #525).
Specfile()has a newsanitizeoption that enables best effort sanitization of potentially dangerous constructs such as shell expansions and unsafe Lua macros before they are passed to RPM for parsing. (#519)- Fixed incorrect parsing of nested macros. (#522)
- Fixed whitespace padding of day of month in changelog entries. (#511)
- Changelog entries that have incorrect padding set for a day of a month are now fixed if possible or ignored. (#508)
- A bug leading to incorrect EVR expansion has been fixed. (#492)
- Prevented side-effects during condition evaluation that could occur when expanding macros that manipulate other macros, leading to misinterpreted validity of condition branches. (#499)
- We have solved a FutureWarning in our codebase. (#485)
- Added support for Elbrus E2K CPU architectures. (#484)
- We have fixed a bug that caused specfile to traceback when section names with conditional macro expansions containing spaces were present in the spec file. (#476)
- We have fixed a bug that caused changes to get lost when a spec file passed as a path was replaced or deleted. (#470)
- Added support for creating Specfile instances from file objects and strings. (#458)
- The
context_managementtype stubs now useParamSpecfromtyping_extensionsto support Python < 3.10. (#466)
- context_management: add a type stub override to fix typing. Type checkers like mypy and pyright can now correctly determine the types for
.sources(),.sections(), and the otherSpecfilemethods that return context managers. (#457)
- Removed the usage of a walrus operator for Python 3.6 compatibility. (#450)
- Added support for detached (open)SUSE style changelogs (#444)
-
There is a new convenience method
Sections.get_or_create()that allows you to manipulate a section without checking if it exists first. If a section doesn't exist, it will be appended to the end. (#441) For example, this will work properly even on spec files without%changelog:with spec.sections() as sections: changelog = sections.get_or_create("changelog") changelog[:] = ["%autochangelog"]
- New minor release for testing in CBS Koji
- We have fixed our parser to take in account the deprecations introduced in Python 3.8 (#420)
- NEVR and NEVRA classes are now hashable (#416)
- specfile can now handle multi-line tag values (enclosed in a macro body, e.g.
%shrink). (#412)
- Explicitly invalidate the global parse hash when a SpecParser instance is created to prevent this issue. (#409)
- Fixed two issues related to condition parsing. (#405)
- It is now possible to bump a release in a manner similar to
rpmdev-bumpspecusingSpecfile.bump_release()method. (#399)
- Value of a
Tagno longer includes trailing whitespace (if any). (#393) - specfile now tries to expand macros before processing conditions to be able to resolve conditional expressions defined by macros, for example OpenSUSE Tumbleweed defines
%ifpython3macro as%if "%{python_flavor}" == "python3". (#394)
- Fixed an exception that occurred when accessing the
Specfile.has_autochangelogproperty while having unparsable lines (e.g. lines ending with unescaped%) in%changelog. (#387)
- Improved compatibility with RPM 4.20 (alpha version is currently in Fedora Rawhide). (#380)
- Fixed several minor issues such as processing seemingly commented-out macro definitions (e.g.
#%global prerel rc1) and treatingSourceLicensetag as a source. (#374, #376) - Made
EVR,NEVRandNEVRAobjects comparable. (#379)
- Handling of trailing newlines in the macro definitions has been improved. (#361)
- We have fixed an issue in
%prepsection processing. For instance, if the%patchesmacro appeared there, it would have been converted to%patch es, causing failure when executing%preplater. (#356)
- A trailing newline is no longer added to spec files without one upon saving. (#353)
- Improved handling of commented-out macro definitions and fixed related logic in
Specfile.update_value(). (#338)
- When accessing tags or macro definitions by name, specfile now takes validity into account when looking for the best match. For example if there are two instances of
Versiontag, one in the true and one in the false branch of a condition,Specfile.versionwill always access the one that is in the true branch. (#328)
- Third pre-release for testing Packit support.
- There is a new method,
Specfile.update_version(), that allows updating spec file version even if it is a pre-release. (#317)
- Second pre-release for testing Packit support.
- First pre-release for testing Packit support.
- Improved type annotations for
UserListsubclasses. (#299) - Macro definitions gained a new
commented_outproperty indicating that a macro definition is commented out. Another new property,comment_out_style, determines if it is achieved by using a%dnl(discard next line) directive (e.g.%dnl %global prerelease beta2) or by replacing the starting%with#(e.g.#global prerelease beta2). (#298)
- Sources now have a
validproperty that indicates whether a source is valid in the current context, meaning it is not present in a false branch of any condition. (#295)
- Removed dependency on setuptools-scm-git-archive. (#290)
- Macro definitions and tags gained a new
validattribute. A macro definition/tag is considered valid if it doesn't appear in a false branch of any condition appearing in the spec file. (#276)
specfileno longer tracebacks when some sources are missing and can't be emulated. In such case the spec file is parsed without them at the cost of%setupand%patchmacros potentially expanding differently than with the sources present. (#271)- Specfile's license in RPM spec file is now confirmed to be SPDX compatible. (#269)
- Fixed Packit config to work properly with
propose-downstreamandpull-from-upstreamjobs. (#261)
- specfile now once again supports EPEL 8 and Python 3.6. (#256)
- Fixed infinite loop when removing macros with
%in the name. (#244) - Added a possibility to undefine system macros by setting a macro value to
Nonein themacrosargument of theSpecfileconstructor. (#244) - Fixed a bug in processing options of
%prepmacros. For instance, when a quoted string appeared inside an expression expansion, it could lead to improper parsing, rendering the spec file invalid after accessing the options. (#253)
- Parsing has been optimized so that even spec files with hundreds of thousands of lines can be processed in reasonable time. (#240)
- Specfile library now handles multiple
%changelogsections. (#230)
- Added a new
guess_packager()function that uses similar heuristics asrpmdev-packager, meaning that theSpecfile.add_changelog_entry()method no longer requiresrpmdev-packagerto guess the changelog entry author. (#220) - The
Specfile.add_changelog_entry()method now uses dates based on UTC instead of the local timezone. (#223)
- Added
Specfile.has_autoreleaseproperty to detect if a spec file uses the%autoreleasemacro. (#221)
- Parsing the spec file by RPM is now performed only if really necessary, greatly improving performance in certain scenarios. (#212)
- Checked that license is a valid SPDX license.
- Fixed a bug that broke parsing in case spec file contained conditionalized macro definitions or similar constructs. (#209)
- Specfile no longer depends on rpm-py-installer, it now depends directly on rpm. (#207)
- Fixed infinite loop that occurred when section options were followed by whitespace. (#197)
- Fixed a bug in section parsing that caused sections to be ignored when there were macro definitions spread across the spec file and not cumulated at the top. (#191)
- Added
Section.optionsattribute for convenient manipulation of section options. (#183) - specfile now supports single-line sections where section content is represented by a macro starting with a newline. (#182)
- Added
evrargument toSpecfile.add_changelog_entry(). This allows adding a changelog entry with an EVR value that's different from the current specfile's value. This makes it easier to reconstruct a specfile's%changelogbased on another source using the higher level interface. (#181)
- All classes including
Specfileitself can now be copied using the standardcopy()anddeepcopy()functions fromcopymodule. (#176) Section.nameattribute has been renamed to a more fittingSection.id. (#167)setup.cfgnow useslicense_filesinstead of deprecatedlicense_file. (#162)
- Tags enclosed in conditional macro expansions are not ignored anymore. (#156)
- Fixed context managers being shared between Specfile instances. (#157)
- Context managers (
Specfile.sections(),Specfile.tags()etc.) can now be nested and combined together (with one exception -Specfile.macro_definitions()), and it is also possible to use tag properties (e.g.Specfile.version,Specfile.license) inside them. It is also possible to access the data directly, avoiding thewithstatement, by using thecontentproperty (e.g.Specfile.tags().content), but be aware that no modifications done to such data will be preserved. You must usewithto make changes. (#153)
- Fixed an issue that caused empty lines originally inside changelog entries to appear at the end. (#140)
- Renamed the
ignore_missing_includesoption to a more generalforce_parse. If specified, it allows to attempt to parse the spec file even if one or more sources required to be present at parsing time are not available. Such sources include sources referenced from shell expansions in tag values and sources included using the%includedirective. (#137)
specfilenow supports localized tags (e.g.Summary(fr)) and tags with qualifiers (e.g.Requires(post)). It also follows more closely rpm parsing logic and doesn't fail on invalid section names. (#132)
- Added utility classes for working with (N)EVR. (#113)
- Fixed an issue with multiple instances of
Specfilenot expanding macros in the right context. (#117)
- Added
Specfile.update_tag()method that allows updating tag values while trying to preserve macro expansions. You can watch a demo on YouTube. (#101)
- It is now possible to filter changelog entries by specifying lower bound EVR, upper bound EVR or both. (#104)
- Added support for filenames specified in source URL fragments, for example:
https://example.com/foo/1.0/download.cgi#/%{name}-%{version}.tar.gz(#100)
- Switched to our own implementation of working with
%changelogtimestamps and removed dependency on arrow (#88) - Fixed requires of EPEL 8 rpm (#86)
- Added new
%confsection (#74) - Switched to rpm-py-installer (#75)
- Fixed detecting extended timestamp format in
%changelog(#77, #81)
- Strict optional typing is now enforced (#68)
- Fixed deduplication of tag names (#69)
- Sources and patches can now be removed by number (#69)
- Number of digits in a source number is now expressed the same way as packit does it (#69)
- Empty lines are now compressed when deleting tags (#69)
- Added convenience property for getting texts of tag comments (#69)
- Added convenience method for adding a patch (#69)
- Added convenience properties for most used tags (#63)
- Hardened linting by ignoring only specific mypy errors (#64)
- Fixed list of valid tag names and ensured newly added tags are not part of a condition block (#66)
- Initial patch number and its default number of digits are now honored (#66)
- Fixed a bug in
%prepmacro stringification (#67)
- Made
SourcesaMutableSequence(#36) - Started using consistent terminology for source numbers and added the option to insert a source with a specific number (#47)
- Added support for implicit source numbering (#48)
- Documented sources and
%prepmacros in README (#49) - Implemented high-level manipulation of version and release (#54)
- Added support for
%autochangelog(#56) - Added
remoteproperty to sources and enabled addition ofSources(#59) - Implemented mid-level manipulation of
%prepsection, including modification of%prepmacros (#37, #52)
- Enabled Zuul CI (#8)
- Switched from git:// to https:// for rebase hook (#22)
- Updated pre-commit configuration and adapted to type changes brought by new version of mypy (#24)
- Non-lowercase section names are now supported (#26)
- Added
Sections.get()convenience method (#29) - Added packit configuration and enabled packit (#25)
- Fixed infinite recursion when deep-copying instances of
SectionsandTags(#30) - Updated Fedora and EPEL spec files (#32)
- Fixed issues caused by older versions of dependencies on EPEL 8 (#33)
- Implemented high-level manipulation of sources and patches (#20, #36)
- It is now possible to parse spec files with missing local sources (#23)
- Fixed parsing Source and Patch tags
- Made
Specfileimportable directly from the package