Reference¶
poetry_up.console¶
Command-line interface.
poetry_up.git¶
Git wrapper.
-
class
poetry_up.git.
MergeRequest
(title: str, description: str)¶ Merge request with a title and a description.
-
poetry_up.git.
add
(paths)¶ Add the specified paths to the index.
- Return type
None
-
poetry_up.git.
branch_exists
(branch)¶ Return True if the branch exists.
- Return type
bool
-
poetry_up.git.
commit
(message)¶ Create a commit using the given message.
- Return type
None
-
poetry_up.git.
current_branch
()¶ Return the checked out branch.
- Return type
str
-
poetry_up.git.
git
(*args, check=True)¶ Invoke git.
- Return type
CompletedProcess
-
poetry_up.git.
is_clean
(paths=())¶ Return True if the working tree, or the given files, are clean.
- Return type
bool
-
poetry_up.git.
push
(remote, branch, merge_request=None)¶ Push the branch to the remote.
- Parameters
remote (
str
) – The remote to push to.branch (
str
) – The branch to be pushed.merge_request (
Optional
[MergeRequest
]) – The merge request to create for the branch (optional).
- Return type
None
-
poetry_up.git.
remove_branch
(branch)¶ Remove the specified branch.
- Return type
None
-
poetry_up.git.
resolve_branch
(branch)¶ Return the SHA1 hash for the given branch.
- Return type
str
-
poetry_up.git.
switch
(branch, create=False, location=None)¶ Switch to the specified branch.
- Parameters
branch (
str
) – The branch to be switched to.create (
bool
) – Create the branch.location (
Optional
[str
]) – The location at which the branch should be created.
- Return type
None
poetry_up.github¶
GitHub wrapper.
-
poetry_up.github.
create_pull_request
(title, body)¶ Create a pull request for the checked out branch.
- Return type
None
-
poetry_up.github.
pull_request_exists
(branch)¶ Return True if a pull request exists for the given branch.
- Return type
bool
poetry_up.poetry¶
Poetry wrapper.
-
class
poetry_up.poetry.
Package
(name: str, old_version: str, new_version: str)¶ Package with current and available versions.
-
poetry_up.poetry.
update
(package, lock=False, latest=False)¶ Update the given package.
- Parameters
package (
Package
) – The package to be updated.lock (
bool
) – If True, do not install the package into the environment.latest (
bool
) – If True, update the version constraint when required.
- Return type
None
poetry_up.update¶
Update module.
-
class
poetry_up.update.
Action
(updater)¶ Base class for actions.
-
property
required
¶ Return True if the action needs to run.
- Return type
bool
-
property
-
class
poetry_up.update.
Actions
(switch: poetry_up.update.Switch, update: poetry_up.update.Update, commit: poetry_up.update.Commit, rollback: poetry_up.update.Rollback, push: poetry_up.update.Push, pull_request: poetry_up.update.PullRequest)¶ Actions for a package update.
-
class
poetry_up.update.
Commit
(updater)¶ Create a Git commit for the update.
-
property
required
¶ Return True if the action needs to run.
- Return type
bool
-
property
-
class
poetry_up.update.
Options
(latest: bool, install: bool, commit: bool, push: bool, merge_request: bool, pull_request: bool, upstream: str, remote: str, dry_run: bool, packages: Tuple[str, ...])¶ Options for the update operation.
-
class
poetry_up.update.
PackageUpdater
(package, options, original_branch)¶ Update a package.
-
property
required
¶ Return True if the package needs to be updated.
- Return type
bool
-
run
()¶ Run the package update.
- Return type
None
-
show
()¶ Print information about the package update.
- Return type
None
-
property
-
class
poetry_up.update.
PullRequest
(updater)¶ Open a pull request for the update branch.
-
property
required
¶ Return True if the action needs to run.
- Return type
bool
-
property
-
class
poetry_up.update.
Push
(updater)¶ Push the update branch to the remote repository.
-
property
required
¶ Return True if the action needs to run.
- Return type
bool
-
property
-
class
poetry_up.update.
Rollback
(updater)¶ Rollback an attempted package update.
-
property
required
¶ Return True if the action needs to run.
- Return type
bool
-
property
-
class
poetry_up.update.
Switch
(updater)¶ Switch to the update branch.
-
property
required
¶ Return True if the action needs to run.
- Return type
bool
-
property
-
class
poetry_up.update.
Update
(updater)¶ Update the package using Poetry.