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

ci: renames on workflows for simplicity #4

Merged
merged 2 commits into from
Nov 6, 2023
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
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion .github/workflows/on-pr.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- "*"

jobs:

test:
runs-on: ubuntu-latest
strategy:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Poetry Plugin: upgrade

![release](https://github.com/apoclyps/poetry-plugin-upgrade/actions/workflows/on-release.yml/badge.svg)
![publish](https://github.com/apoclyps/poetry-plugin-upgrade/actions/workflows/on-publish.yml/badge.svg)
![test](https://github.com/apoclyps/poetry-plugin-upgrade/actions/workflows/on-pr.yml/badge.svg)
![release](https://github.com/apoclyps/poetry-plugin-upgrade/actions/workflows/release.yml/badge.svg)
![publish](https://github.com/apoclyps/poetry-plugin-upgrade/actions/workflows/publish.yml/badge.svg)
![test](https://github.com/apoclyps/poetry-plugin-upgrade/actions/workflows/test.yml/badge.svg)
[![license](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)
![python_version](https://img.shields.io/badge/Python-%3E=3.8-blue)
![poetry_version](https://img.shields.io/badge/Poetry-%3E=1.6-blue)
Expand Down
7 changes: 3 additions & 4 deletions src/poetry_plugin_upgrade/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,13 @@ def handle_version(current_version: str, candidate: Package) -> str:

if current_version.startswith(">="):
version_constraint = ">="
elif current_version[0] == ">":
version_constraint = ">"

if current_version.startswith("=="):
version_constraint = "=="

if current_version[0] == ">":
version_constraint = ">"

return f"{version_constraint}{candidate.pretty_version}"
return f"{version_constraint}{candidate.pretty_version}" if version_constraint else candidate.pretty_version

@staticmethod
def is_bumpable(
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_command_with_latest(
expected = PyProjectTOML(path).file.read()

assert app_tester.execute("upgrade --latest") == 0
assert dict(PyProjectTOML(tmp_pyproject_path).file.read()) == expected
assert PyProjectTOML(tmp_pyproject_path).file.read() == expected
command_call.assert_called_once_with(name="update")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ waldo = { git = "https://example.com/test/project.git" }
fred = "1.1.1"
plugh = "^2.2.2"
xyzzy = "~2.2.2"
nacho = "2.2.2"
nacho = "<1.1.1"
thud = ">2.2.2"

[tool.poetry.group.docs.dependencies]
foobar = "2.2.2"
foobar = "<=1.1.1"
foobaz = ">=2.2.2"
fooqux = "2.2.2"
fooquux = "2.2.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ waldo = { git = "https://example.com/test/project.git" }
fred = "1.1.1"
plugh = "^2.2.2"
xyzzy = "~2.2.2"
nacho = "2.2.2"
nacho = "<1.1.1"
thud = ">2.2.2"

[tool.poetry.group.docs.dependencies]
foobar = "2.2.2"
foobar = "<=1.1.1"
foobaz = ">=2.2.2"
fooqux = "2.2.2"
fooquux = "*"
Expand Down