Skip to content

Commit

Permalink
bump pyprojectx and drop support for python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
DetachHead committed Jul 1, 2024
1 parent 948a540 commit e3b50b6
Show file tree
Hide file tree
Showing 17 changed files with 96 additions and 146 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check and publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.8", "3.12"]
python_version: ["3.9", "3.12"]
# pinning macos version because apparently newer versions of macos don't work with lxml
# https://stackoverflow.com/a/76776773
os: ["ubuntu-latest", "macos-12", "windows-latest"]
Expand All @@ -34,7 +34,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.8", "3.12"]
python_version: ["3.9", "3.12"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ unlike many projects, i try to make mine as easy as possible for other developer

## prerequisites

- python (>=3.8)
- python (>=3.9)
- vscode (optional)
- shows inline errors for all linters used in the CI
- applies formatting fixes on save to prevent formatting errors from occurring in the CI
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ running tests in parallel using [pytest-xdist](https://pytest-xdist.readthedocs.

# config

pass `--capture=no` to make `logger.console` work properly.
pass `--capture=no` to make `logger.console` work properly.

since this is a pytest plugin, you should avoid using robot options that have pytest equivalents:

Expand Down Expand Up @@ -412,6 +412,6 @@ pycharm currently does not support pytest plugins for non-python files. see [thi

| dependency | version range | comments |
| :------------- | :------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| python | `>=3.8,<4.0` | all versions of python will be supported until their end-of-life as described [here](https://devguide.python.org/versions/) |
| python | `>=3.9,<4.0` | all versions of python will be supported until their end-of-life as described [here](https://devguide.python.org/versions/) |
| robotframework | `>=6.1,<8.0` | i will try to support at least the two most recent major versions. robot 6.0 is not supported as the parser API that the plugin relies on to support tests written in python was introduced in version 6.1 |
| pytest | `>=7.0,<9.0` | may work on other versions, but things may break since this plugin relies on some internal pytest modules |
82 changes: 23 additions & 59 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 15 additions & 8 deletions pw
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import sys
from pathlib import Path
from venv import EnvBuilder

VERSION = "2.2.0"
VERSION = "3.0.1rc2"

PYPROJECTX_INSTALL_DIR_ENV_VAR = "PYPROJECTX_INSTALL_DIR"
PYPROJECTX_PACKAGE_ENV_VAR = "PYPROJECTX_PACKAGE"
Expand Down Expand Up @@ -80,13 +80,20 @@ def arg_parser():
action="store",
help=f"The directory where all tools (including pyprojectx) are installed; defaults to the "
f"{PYPROJECTX_INSTALL_DIR_ENV_VAR} environment value if set, else '.pyprojectx' "
f"in the same directory as the invoked pw script",
f"in the same directory as the invoked pw script.",
)
parser.add_argument(
"--force-install",
"-f",
action="store_true",
help="Force clean installation of the virtual environment used to run cmd, if any",
help="Force clean installation of the virtual environment used to run cmd, if any.",
)
parser.add_argument(
"--clean",
"-c",
action="store_true",
help="Clean .pyprojectx directory by removing all but the current versions "
"of pyprojectx and context virtual environments.",
)
parser.add_argument(
"--install-context",
Expand All @@ -105,7 +112,7 @@ def arg_parser():
"--quiet",
"-q",
action="store_true",
help="Suppress output",
help="Suppress output.",
)
parser.add_argument(
"--info",
Expand Down Expand Up @@ -143,13 +150,13 @@ def arg_parser():

def ensure_pyprojectx(options):
env_builder = EnvBuilder(with_pip=True)
venv_dir = options.install_path.joinpath(
"pyprojectx", f"{options.version}-py{sys.version_info.major}.{sys.version_info.minor}"
venv_dir = (
options.install_path / "pyprojectx" / f"{options.version}-py{sys.version_info.major}.{sys.version_info.minor}"
)
env_context = env_builder.ensure_directories(venv_dir)
pyprojectx_script = Path(env_context.bin_path, "pyprojectx")
pyprojectx_exe = Path(env_context.bin_path, "pyprojectx.exe")
pip_cmd = [env_context.env_exe, "-m", "pip", "install"]
pip_cmd = [env_context.env_exe, "-m", "pip", "install", "--pre"]

if options.quiet:
out = subprocess.DEVNULL
Expand Down Expand Up @@ -184,4 +191,4 @@ def ensure_pyprojectx(options):


if __name__ == "__main__":
run(sys.argv[1:])
run(sys.argv[1:])
4 changes: 2 additions & 2 deletions pw.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[pdm]
requirements = ["CacheControl==0.14.0", "Pygments==2.17.2", "blinker==1.7.0", "certifi==2024.2.2", "charset-normalizer==3.3.2", "dep-logic==0.0.4", "distlib==0.3.8", "filelock==3.13.1", "findpython==0.4.1", "idna==3.6", "installer==0.7.0", "markdown-it-py==3.0.0", "mdurl==0.1.2", "msgpack==1.0.7", "packaging==23.2", "pdm==2.12.3", "platformdirs==4.2.0", "pyproject_hooks==1.0.0", "python-dotenv==1.0.1", "requests-toolbelt==1.0.0", "requests==2.31.0", "resolvelib==1.0.1", "rich==13.7.0", "shellingham==1.5.4", "tomlkit==0.12.3", "truststore==0.8.0", "unearth==0.14.0", "urllib3==2.2.1", "virtualenv==20.25.1"]
hash = "97b36b001901d8eb168801ffb36a41df"
requirements = ["anyio==4.4.0", "blinker==1.8.2", "certifi==2024.6.2", "dep-logic==0.3.1", "distlib==0.3.8", "filelock==3.15.4", "findpython==0.6.1", "h11==0.14.0", "hishel==0.0.29", "httpcore==1.0.5", "httpx==0.27.0", "idna==3.7", "installer==0.7.0", "markdown-it-py==3.0.0", "mdurl==0.1.2", "msgpack==1.0.8", "packaging==24.1", "pbs-installer==2024.4.24", "pdm==2.16.1", "platformdirs==4.2.2", "pygments==2.18.0", "pyproject-hooks==1.1.0", "python-dotenv==1.0.1", "resolvelib==1.0.1", "rich==13.7.1", "shellingham==1.5.4", "sniffio==1.3.1", "socksio==1.0.0", "tomlkit==0.12.5", "truststore==0.9.1 ; python_version >= '3.10'", "typing-extensions==4.12.2", "unearth==0.15.5", "virtualenv==20.26.3"]
hash = "228424c509dec4543c5c7b8f68f4e875"
9 changes: 3 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies = [
"basedtyping<0.2,>=0.1.0",
"ansi2html>=1.9.1",
]
requires-python = ">=3.8,<4.0"
requires-python = ">=3.9,<4.0"
readme = "README.md"
license = { text = "MIT" }

Expand Down Expand Up @@ -176,7 +176,7 @@ enable_assertion_pass_hook = true

[tool.basedpyright]
ignore = ["pw"]
pythonVersion = "3.8"
pythonVersion = "3.9"
pythonPlatform = "All"
typeCheckingMode = "all"
reportMissingTypeStubs = false # https://github.com/robotframework/robotframework/issues/4822
Expand All @@ -187,7 +187,7 @@ reportUnusedVariable = false # covered by ruff (has quickfix)

[tool.ruff]
unsafe-fixes = true
target-version = "py38"
target-version = "py39"
respect-gitignore = true
line-length = 100
preview = true
Expand Down Expand Up @@ -260,9 +260,6 @@ combine-as-imports = true
required-imports = ["from __future__ import annotations"]
split-on-trailing-comma = false

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"contextlib.AbstractContextManager".msg = "Use `typing.ContextManager` instead because it works at runtime on python 3.8."

[tool.robotidy]
configure = [
"AlignTemplatedTestCases:enabled=True",
Expand Down
Loading

0 comments on commit e3b50b6

Please sign in to comment.