Skip to content

Commit

Permalink
Update python dependencies (#146)
Browse files Browse the repository at this point in the history
* Bump ruff from 0.1.15 to 0.3.5

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.1.15 to 0.3.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@v0.1.15...v0.3.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update all python dependencies and python to 3.11

* Remove usage of deprecated pkg_resources

* Bump poetry version on dockerfile

* Bump nix github actions

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
mbovo and dependabot[bot] authored Jun 4, 2024
1 parent 0c83542 commit 20969e9
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 172 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
has devbox && eval "$(devbox generate direnv --print-envrc)" && exit 0
#has devbox && eval "$(devbox generate direnv --print-envrc)" && exit 0

has nix && use flake
6 changes: 3 additions & 3 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- uses: cachix/cachix-action@v14
- uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: cachix/cachix-action@v15
with:
name: pdh
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
Expand Down
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ tasks:
setup:
desc: Bootstrap dev environment
preconditions:
- sh: "[ $(python3 --version | cut -d ' ' -f 2 | awk -F'.' '{print ($2 >= 8) }') = 1 ]"
msg: "Required python version not found (>=3.8)"
- sh: "[ $(python3 --version | cut -d ' ' -f 2 | awk -F'.' '{print ($2 >= 11) }') = 1 ]"
msg: "Required python version not found (>=3.11)"
cmds:
- task: pre-commit-setup
- task: poetry-setup
Expand Down
2 changes: 1 addition & 1 deletion containers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WORKDIR /app
COPY . /app/
RUN apt-get update && apt-get install -y curl=* \
&& sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d \
&& pip install --no-cache-dir poetry==1.1.9 \
&& pip install --no-cache-dir poetry==1.8.1 \
&& ./bin/task build

FROM python:3.11-slim
Expand Down
295 changes: 148 additions & 147 deletions poetry.lock

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,35 @@ ignore = [

[tool.poetry]
name = "pdh"
version = "0.3.20"
version = "0.4.0"
description = "Pagerduty CLI for Humans"
authors = ["Manuel Bovo <manuel.bovo@gmail.com>"]
license = "GPL-3.0-or-later"
repository = "https://github.com/mbovo/pdh"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.6"
python = "^3.11"
click = "^8.1.7"
colorama = "^0.4.4"
colorama = "^0.4.6"
pdpyras = "^5.2.0"
rich = "^13.7.0"
PyYAML = "^6.0"
rich = "^13.7.1"
PyYAML = "^6.0.1"
humanize = "^4.9.0"
jsonpath-ng = "^1.5.3"
jsonpath-ng = "^1.6.1"
deprecation = "^2.1.0"
setuptools = "^69.0.0"


[tool.poetry.group.dev.dependencies]
black = "^23.12.1"
pytest = "^7.4.4"
pytest-cov = "^4.1.0"
pytest-xdist = "^3.5.0"
pytest-flake8 = "^1.0.7"
pytest-mock = "^3.6.1"
autopep8 = "^2.0.4"
ruff = "^0.1.11"
black = "^24.4.2"
pytest = "^8.2.1"
pytest-cov = "^5.0.0"
pytest-xdist = "^3.6.1"
pytest-flake8 = "^1.1.1"
pytest-mock = "^3.14.0"
autopep8 = "^2.2.0"
ruff = "^0.4.7"

[tool.poetry.scripts]
pdh = "pdh.main:main"
Expand Down
4 changes: 2 additions & 2 deletions src/pdh/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import click
import pkg_resources
import importlib.metadata
import sys
import re
import os
Expand Down Expand Up @@ -56,7 +56,7 @@ def config(config):

@main.command(help="Print cloud tools version and exit")
def version():
click.echo(f"v{pkg_resources.get_distribution('pdh').version}")
click.echo(f"v{importlib.metadata.version('pdh')}")


@main.group(help="Operater on Users")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from rich.console import Console
from pdh import main
from click import testing
import pkg_resources
import importlib.metadata


def test_assert_true():
Expand All @@ -34,7 +34,7 @@ def test_main_version():
runner = testing.CliRunner()
result = runner.invoke(main.main, "version")
assert result.exit_code == 0
assert result.stdout == f"v{pkg_resources.get_distribution('pdh').version}\n"
assert result.stdout == f"v{importlib.metadata.version('pdh')}\n"


def test_print_items_table():
Expand Down

0 comments on commit 20969e9

Please sign in to comment.