Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add install from pull request instructions #838

Merged
merged 6 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]
[issues]: https://github.com/Taxel/PlexTraktSync/issues
[opening a new issue]: https://github.com/Taxel/PlexTraktSync/issues/new

## Install code from Pull request

Replace `838` with a pull request you intend to install

```
$ pipx install --suffix=@838 'git+https://github.com/Taxel/PlexTraktSync@refs/pull/838/head'
installed package PlexTraktSync 0.18.0.dev0 (PlexTraktSync838), installed using Python 3.10.2
These apps are now globally available
- plextraktsync@838
done! ✨ 🌟 ✨
```

You can also use a convenience wrapper (this requires you install `plextraktsync` with `pipx` first):
```
$ plextraktsync self-update --pr 838
```

## Checking out code

If you checkout a specific version, this can be done in one of two ways:
Expand Down
2 changes: 1 addition & 1 deletion plextraktsync/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.20.x"
__version__ = "0.20.0dev0"
21 changes: 20 additions & 1 deletion plextraktsync/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import click

from plextraktsync.commands.self_update import enable_self_update, self_update
from plextraktsync.commands.self_update import enable_self_update
from plextraktsync.factory import factory

CONFIG = factory.config()
Expand Down Expand Up @@ -237,6 +237,25 @@ def subdl():
pass


@command()
@click.option(
"--pr",
type=int,
default=False,
help="Update to Pull Request Id",
)
def self_update():
"""
Update PlexTraktSync to the latest version using pipx

\b
$ plextraktsync self-update
Updating PlexTraktSync to latest using pipx
upgraded package plextraktsync from 0.15.3 to 0.18.5 (location: /Users/glen/.local/pipx/venvs/plextraktsync)
"""
pass


@command()
def bug_report():
"""
Expand Down
19 changes: 7 additions & 12 deletions plextraktsync/commands/self_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,11 @@ def enable_self_update():
return package is not None


@click.command()
def self_update():
"""
Update PlexTraktSync to latest version using pipx

\b
$ plextraktsync self-update
Updating PlexTraktSync to latest using pipx
upgraded package plextraktsync from 0.15.3 to 0.18.5 (location: /Users/glen/.local/pipx/venvs/plextraktsync)
"""

click.echo("Updating PlexTraktSync to latest using pipx")
def self_update(pr: int):
if pr:
click.echo(f"Updating PlexTraktSync to the pull request #{pr} version using pipx")
system(f"pipx install --suffix=@{pr} --force git+https://github.com/Taxel/PlexTraktSync@refs/pull/{pr}/head")
return

click.echo("Updating PlexTraktSync to the latest version using pipx")
system("pipx upgrade PlexTraktSync")
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools-declarative-requirements",
"setuptools-declarative-requirements>=1.3.0",
"setuptools>=42",
"wheel",
]
Expand Down