From 2e5d7223515d8f99e51851dbcc38a76dd7332742 Mon Sep 17 00:00:00 2001 From: Christopher Carroll Smith Date: Tue, 23 Apr 2024 14:53:06 -0400 Subject: [PATCH] Removed deprecated 'pkg_resources' dependency --- .github/workflows/actions.yml | 4 +--- imfp/utils.py | 6 +----- poetry.lock | 27 ++++++--------------------- pyproject.toml | 1 - 4 files changed, 8 insertions(+), 30 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 5a355c1..4fd503f 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -27,7 +27,6 @@ jobs: uses: snok/install-poetry@v1 - name: Build and install project run: | - poetry cache clear --all . poetry install - name: Run tests with pytest run: | @@ -43,12 +42,11 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.12' - name: Install and configure Poetry uses: snok/install-poetry@v1 - name: Publish to PyPi run: | - poetry build poetry publish --build if [ $? -ne 0 ]; then echo "Warning: Version has not been incremented. No new version published." diff --git a/imfp/utils.py b/imfp/utils.py index d340856..ce781b9 100644 --- a/imfp/utils.py +++ b/imfp/utils.py @@ -4,7 +4,6 @@ from requests import get from json import loads, load, dump, JSONDecodeError from pandas import DataFrame -from pkg_resources import get_distribution, DistributionNotFound import re @@ -81,10 +80,7 @@ def _download_parse(URL, times=3): if app_name: app_name = app_name[:255] else: - try: - app_name = f'imfp/{get_distribution("imfp").version}' - except DistributionNotFound: - app_name = "imfp" + app_name = "imfp" headers = {"Accept": "application/json", "User-Agent": app_name} for _ in range(times): diff --git a/poetry.lock b/poetry.lock index d936c55..214e53b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -382,18 +382,19 @@ files = [ [[package]] name = "platformdirs" -version = "4.2.0" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +version = "4.2.1" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" files = [ - {file = "platformdirs-4.2.0-py3-none-any.whl", hash = "sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068"}, - {file = "platformdirs-4.2.0.tar.gz", hash = "sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768"}, + {file = "platformdirs-4.2.1-py3-none-any.whl", hash = "sha256:17d5a1161b3fd67b390023cb2d3b026bbd40abde6fdb052dfbd3a29c3ba22ee1"}, + {file = "platformdirs-4.2.1.tar.gz", hash = "sha256:031cd18d4ec63ec53e82dceaac0417d218a6863f7745dfcc9efe7793b7039bdf"}, ] [package.extras] docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] +type = ["mypy (>=1.8)"] [[package]] name = "pluggy" @@ -590,22 +591,6 @@ urllib3 = ">=1.25.10,<3.0" [package.extras] tests = ["coverage (>=6.0.0)", "flake8", "mypy", "pytest (>=7.0.0)", "pytest-asyncio", "pytest-cov", "pytest-httpserver", "tomli", "tomli-w", "types-requests"] -[[package]] -name = "setuptools" -version = "69.5.1" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "setuptools-69.5.1-py3-none-any.whl", hash = "sha256:c636ac361bc47580504644275c9ad802c50415c7522212252c033bd15f301f32"}, - {file = "setuptools-69.5.1.tar.gz", hash = "sha256:6c1fccdac05a97e598fb0ae3bbed5904ccb317337a51139dcd51453611bbb987"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - [[package]] name = "six" version = "1.16.0" @@ -670,4 +655,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "6ee9cb57f1fda95ca46851b6b7ba16d5253a0d129cd584983f5ab3987bae4299" +content-hash = "10770207cd3e2a117460afb39ee7cfc636e659daf6c31374e569f67b939604f1" diff --git a/pyproject.toml b/pyproject.toml index 12035cf..abc0b98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,6 @@ pytest = "^7.2.2" pytest-runner = "^6.0.0" black = "^23.3.0" pytest-mock = "^3.10.0" -setuptools = "^69.5.1" [build-system] requires = ["poetry-core"]