Skip to content

Commit

Permalink
Bump python-version lowerbound to 3.11
Browse files Browse the repository at this point in the history
Also, updated 3rd party that was added to stdlib:
- importlib.resources instead of importlib_resources
- tomllib instead of tomli
  • Loading branch information
pedro-psb committed Jul 31, 2024
1 parent 37fdf20 commit 62669e7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "pulp-docs"
version = "0.0.1"
requires-python = ">= 3.11"
dependencies = [
"mkdocs-material",
"mkdocstrings",
Expand All @@ -13,10 +14,8 @@ dependencies = [
"mkdocs-site-urls",
"mkdocs-literate-nav",
"bs4",
"importlib_resources",
"httpx",
"rich",
"tomli",
]

[project.scripts]
Expand Down
6 changes: 3 additions & 3 deletions src/pulp_docs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import typing as t
from pathlib import Path

from importlib_resources import files
from importlib.resources import files

TMP_DIR = Path("tmp")
WORKDIR = Path.home() / "workspace" / "multirepo-prototype"
Expand Down Expand Up @@ -36,8 +36,8 @@ def __init__(self, from_environ: bool = False):
if from_environ is False:
self.verbose = False
self.workdir = Path().absolute()
self.mkdocs_file = files("pulp_docs").joinpath("data/mkdocs.yml").absolute()
self.repolist = files("pulp_docs").joinpath("data/repolist.yml").absolute()
self.mkdocs_file = files("pulp_docs").joinpath("data/mkdocs.yml")
self.repolist = files("pulp_docs").joinpath("data/repolist.yml")
self.clear_cache = False

if env_mkdocs := os.environ.get("PULPDOCS_MKDOCS_FILE"):
Expand Down
4 changes: 2 additions & 2 deletions src/pulp_docs/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pathlib import Path
from typing import NamedTuple, Optional

from importlib_resources import files
from importlib.resources import files

from pulp_docs.constants import BASE_TMPDIR_NAME
from pulp_docs.repository import Repos
Expand All @@ -20,7 +20,7 @@ def main(
output_dir: Path, plugins_filter: Optional[list[str]] = None, dry_run: bool = False
):
"""Creates openapi json files for all or selected plugins in output dir."""
repolist = files("pulp_docs").joinpath("data/repolist.yml").absolute()
repolist = str(files("pulp_docs").joinpath("data/repolist.yml"))
repos = Repos.from_yaml(repolist).get_repos(["content"])
if plugins_filter:
repos = [p for p in repos if p.name in plugins_filter]
Expand Down
4 changes: 2 additions & 2 deletions src/pulp_docs/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import httpx
import configparser
import tomli
import tomllib
import yaml

from pulp_docs.utils.general import get_git_ignored_files
Expand Down Expand Up @@ -151,7 +151,7 @@ def download(
else:
version_file = src_copy_path / "pyproject.toml"
if version_file.exists():
content = tomli.loads(version_file.read_text())
content = tomllib.loads(version_file.read_text())
self.version = (
content.get("tool", {})
.get("bumpversion", {})
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
requires =
tox>=4
env_list = py{38,39,310,311,312}
env_list = py{311,312}

[testenv]
description = run tests
Expand Down

0 comments on commit 62669e7

Please sign in to comment.