Bumper Cars¶
- class bumper.cars.AbstractBumper(target, detail=False, test_drive=False)[source]¶
Abstract implementation for all bumper cars
Parameters: - target (str) – Path to a target file to bump.
- detail (bool) – Generate detailed changes from changelog if possible.
- test_drive (bool) – Perform a dry run
- all_package_versions(name)[source]¶
List of all versions, in descending order, for the given package name.
- bump(bump_reqs=None, **kwargs)[source]¶
Bump dependencies using given requirements.
Parameters: - bump_reqs (RequirementsManager) – Bump requirements manager
- kwargs (dict) – Additional args from argparse. Some bumpers accept user options, and some not.
Returns: List of Bump changes made.
- classmethod bump_message(bumps, include_changes=False)[source]¶
Compose a bump message for the given bumps
Parameters: - bumps (list) – List of Bump instances
- include_changes (bool) – Indicate if the message should include detailed changes.
- package_changes(name, current_version, new_version)[source]¶
List of changes for package name from current_version to new_version, in descending order. If current version is higher than new version (downgrade), then a minus sign will be prefixed to each change.
- class bumper.cars.Bump(name, new_version=None, changes=None, requirements=None)[source]¶
A change made in a target file.
Parameters: - name (str) – Name of the product/library that was bumped
- new_version (tuple) – New version that was bumped to in (op, version) format.
- changes (list) – Detailed changelog entries from the old version to the new version
- requirements (str|list) – Any requirements that must be fulfilled for this bump to occur.
- class bumper.cars.BumpRequirement(req, required=False)[source]¶
A single requirement to be bumped or filtered. It is a wrapper on top of pkg_resources.Requirement.
Parameters: - req (pkg_resources.Requirement) –
- required (bool) – Is this requirement required to be fulfilled? If not, then it is a filter.
- class bumper.cars.RequirementsBumper(target, detail=False, test_drive=False)[source]¶
Bumper for requirements.txt or pinned.txt
- class bumper.cars.RequirementsManager(requirements=None)[source]¶
Manage a list of BumpRequirement
Parameters: requirements (list) – List of requirements to manage - add(requirements, required=None)[source]¶
Add requirements to be managed
Parameters: - requirements (list/Requirement) – List of BumpRequirement or pkg_resources.Requirement
- required (bool) – Set required flag for each requirement if provided.
- check(context, version=None)[source]¶
Check off requirements that are met by name/version.
Parameters: context (str|Bump|Requirement) – Either package name, requirement string, Bump, BumpRequirement, or :class:`pkg_resources.Requirement instance Returns: True if any requirement was satisified by context