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

build: bump poetry.lock dependencies and pre-commit hooks #383

Merged
merged 6 commits into from
Jan 30, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ repos:
- id: no-commit-to-branch

- repo: https://github.com/psf/black
rev: ec91a2be3c44d88e1a3960a4937ad6ed3b63464e # frozen: 23.12.1
rev: e026c93888f91a47a9c9f4e029f3eb07d96375e6 # frozen: 24.1.1
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 1d42195ebc67a509991eaf68c2353e0181003a95 # frozen: v0.1.14
rev: bbaf495f2dc6ce2853c91dc0b2c75d3b8249c15c # frozen: v0.1.15
hooks:
- id: ruff

- repo: https://github.com/dosisod/refurb
rev: a295cee6d188f5797aefe5d7cf77a353ed48ea93 # frozen: v1.27.0
rev: a9a4edd45687e664dee0905ba1c848bda227d1d6 # frozen: v1.28.0
hooks:
- id: refurb

Expand Down
411 changes: 188 additions & 223 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/phylum/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Top-level package for phylum."""

from importlib.metadata import metadata, version
import logging

Expand Down
1 change: 1 addition & 0 deletions src/phylum/ci/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide the `python -m <module_name>` format to 'run library module as a script'."""

from phylum.ci.cli import script_main

script_main()
1 change: 1 addition & 0 deletions src/phylum/ci/ci_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* https://learn.microsoft.com/rest/api/azure/devops/git/pull-request-threads/list
* https://learn.microsoft.com/rest/api/azure/devops/git/pull-request-threads/create
"""

from argparse import Namespace
import base64
from functools import cached_property, lru_cache
Expand Down
1 change: 1 addition & 0 deletions src/phylum/ci/ci_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
integration (CI) environment. Common functionality is provided where possible and CI specific features are
designated as abstract methods to be defined in specific CI environments.
"""

from abc import ABC, abstractmethod
from argparse import Namespace
from collections import OrderedDict
Expand Down
1 change: 1 addition & 0 deletions src/phylum/ci/ci_bitbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/
* https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pullrequest
"""

from argparse import Namespace
from functools import cached_property, lru_cache
import os
Expand Down
1 change: 1 addition & 0 deletions src/phylum/ci/ci_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* https://docs.github.com/en/rest/pulls/comments
* https://docs.github.com/en/rest/guides/working-with-comments#pull-request-comments
"""

from argparse import Namespace
from functools import cached_property, lru_cache
import json
Expand Down
1 change: 1 addition & 0 deletions src/phylum/ci/ci_gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html
* https://docs.gitlab.com/ee/api/notes.html#merge-requests
"""

from argparse import Namespace
from functools import cached_property, lru_cache
import os
Expand Down
1 change: 1 addition & 0 deletions src/phylum/ci/ci_none.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This might be useful for running locally.
This is also the fallback implementation to use when no known CI platform is detected.
"""

import argparse
from functools import cached_property
import re
Expand Down
1 change: 1 addition & 0 deletions src/phylum/ci/ci_precommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* https://pre-commit.com/index.html#pre-commit-during-commits
* https://pre-commit.com/index.html#arguments-pattern-in-hooks
"""

import argparse
from functools import cached_property
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/phylum/ci/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Console script for phylum-ci."""

import argparse
from collections.abc import Sequence
import os
Expand Down
1 change: 1 addition & 0 deletions src/phylum/ci/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide common data structures for the package."""

import dataclasses
from enum import IntEnum
import json
Expand Down
1 change: 1 addition & 0 deletions src/phylum/ci/depfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Dependency files can be either lockfiles or manifests.
This module/class represents a single dependency file.
"""

from enum import Enum
from functools import cache, cached_property
import json
Expand Down
1 change: 1 addition & 0 deletions src/phylum/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The `rich` library is used here for excellent control over the console.
Reference: https://rich.readthedocs.io/en/latest/index.html
"""

from collections.abc import Mapping
from typing import Union

Expand Down
1 change: 1 addition & 0 deletions src/phylum/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide constants for use throughout the package."""

from phylum import __version__

# This is the minimum CLI version supported for new installs.
Expand Down
1 change: 1 addition & 0 deletions src/phylum/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide custom exceptions for the package."""

import subprocess
import sys

Expand Down
1 change: 1 addition & 0 deletions src/phylum/exts/ci/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Package for custom Phylum analysis extension."""

import pathlib

# Provide the path to this extension's directory
Expand Down
1 change: 1 addition & 0 deletions src/phylum/github.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide methods for interacting with the GitHub API."""

import os
import textwrap
import time
Expand Down
1 change: 1 addition & 0 deletions src/phylum/init/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide the `python -m <module_name>` format to 'run library module as a script'."""

from phylum.init.cli import main

main()
4 changes: 3 additions & 1 deletion src/phylum/init/cli.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""Console script for phylum-init."""

import argparse
from collections.abc import Sequence
from functools import lru_cache
import itertools
import operator
import os
import pathlib
from pathlib import Path
Expand Down Expand Up @@ -140,7 +142,7 @@ def supported_releases() -> list[str]:
except InvalidVersion as err:
msg = f"An invalid version was provided: {rel_ver}"
raise SystemExit(msg) from err
sorted_cli_releases = [rel for rel, _ in sorted(cli_releases.items(), key=lambda x: x[1], reverse=True)]
sorted_cli_releases = [rel for rel, _ in sorted(cli_releases.items(), key=operator.itemgetter(1), reverse=True)]
releases = itertools.takewhile(is_supported_version, sorted_cli_releases)

return list(releases)
Expand Down
1 change: 1 addition & 0 deletions src/phylum/init/sig.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
https://raw.githubusercontent.com/phylum-dev/cli/main/scripts/signing-key.pub since that is where the quickstart
documentation directs CLI users.
"""

from pathlib import Path
from textwrap import dedent

Expand Down
1 change: 1 addition & 0 deletions src/phylum/logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configure the logging features for the package."""

import inspect
import logging
import sys
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Aggregate the pytest fixtures in one location."""

from collections.abc import Generator

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Place test package constants here."""

import pathlib

import tomli
Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_ci.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""""Test the phylum-ci command line interface (CLI)."""

import logging
import subprocess
import sys
Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_init.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""""Test the phylum-init command line interface (CLI)."""

import logging
from pathlib import Path
import subprocess
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the package logging capabilities."""

import logging

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_sig.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the signature verification module."""

from textwrap import dedent

from cryptography.hazmat.primitives.asymmetric import rsa
Expand Down