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

bump the planet #44

Merged
merged 4 commits into from
Apr 4, 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
4 changes: 4 additions & 0 deletions .github/workflows/actions/stew-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ runs:
shell: bash
run: python -m pipx install "poetry${{ inputs.poetry-version }}"

- name: poetry-export
shell: bash
run: python -m pipx inject poetry poetry-plugin-export

- name: Ensure correct python version
shell: bash
run: poetry env use python
Expand Down
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ runs:

run: |
$PYTHON_EXEC -m pipx install "poetry$POETRY_VERSION"
$PYTHON_EXEC -m pipx inject poetry poetry-plugin-export
$PYTHON_EXEC -m pipx install "coveo-stew$COVEO_STEW_VERSION"

- name: Run stew ci
Expand Down
14 changes: 8 additions & 6 deletions coveo_stew/ci/stew_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ async def _launch(self, environment: PythonEnvironment, *extra_args: str) -> Run
offline_install_location,
"--target",
temporary_folder / "pip-install-test",
"--pre"
if any(
p.allow_prereleases
for p in self._pyproject.package.dependencies.values()
)
else "",
(
"--pre"
if any(
p.allow_prereleases
for p in self._pyproject.package.dependencies.values()
)
else ""
),
),
)
finally:
Expand Down
33 changes: 11 additions & 22 deletions coveo_stew/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,34 @@
"""Exceptions thrown by the stew scripts."""


class StewException(Exception):
...
class StewException(Exception): ...


class CannotLoadProject(StewException):
...
class CannotLoadProject(StewException): ...


class NotAPoetryProject(StewException):
...
class NotAPoetryProject(StewException): ...


class RequirementsOutdated(StewException):
...
class RequirementsOutdated(StewException): ...


class PythonProjectNotFound(StewException):
...
class PythonProjectNotFound(StewException): ...


class LockNotFound(StewException):
...
class LockNotFound(StewException): ...


class ToolNotFound(StewException):
...
class ToolNotFound(StewException): ...


class MypyNotFound(StewException):
...
class MypyNotFound(StewException): ...


class CheckFailed(StewException):
...
class CheckFailed(StewException): ...


class CheckError(StewException):
...
class CheckError(StewException): ...


class UsageError(StewException):
...
class UsageError(StewException): ...
7 changes: 4 additions & 3 deletions coveo_stew/offline_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
from pathlib import Path
from tempfile import mkstemp
from typing import Optional, Pattern, Set
from typing import List, Optional, Pattern, Set

from coveo_styles.styles import ExitWithFailure
from coveo_systools.platforms import WINDOWS
Expand Down Expand Up @@ -110,7 +110,7 @@ def _store_dependencies_in_wheelhouse(self, project: Optional[PythonProject] = N
"""Store the dependency wheels in the wheelhouse."""
project = project or self.project

lines = []
lines: List[str] = []
for requirement in project.export().splitlines():
if match := LOCAL_REQUIREMENT_PATTERN.match(requirement):
dependency_name, dependency_location = match["library_name"].strip(), Path(
Expand Down Expand Up @@ -156,7 +156,8 @@ def _store_dependencies_in_wheelhouse(self, project: Optional[PythonProject] = N

def _validate_package(self, package_specification: str) -> None:
"""Validates that a package and all its dependencies can be resolved from the wheelhouse.
Package specification can be a name like `coveo-functools` or a constraint like `coveo-functools>=0.2.1`"""
Package specification can be a name like `coveo-functools` or a constraint like `coveo-functools>=0.2.1`
"""
# using check_output will silence output
_ = check_output(
*self.environment.build_command(
Expand Down
Empty file.
3 changes: 1 addition & 2 deletions coveo_stew/pydev.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
from coveo_stew.stew import PythonProject


class NotPyDevProject(StewException):
...
class NotPyDevProject(StewException): ...


def is_pydev_project(project: PythonProject) -> bool:
Expand Down
307 changes: 163 additions & 144 deletions poetry.lock

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@ packages = [

[tool.poetry.dependencies]
python = ">3.8.1,<4"
click = ">=8.1"
click = "^8.1.0"
coveo-functools = "^2.0.0"
coveo-itertools = "^2.0.0"
coveo-systools = "^2.0.10"
coveo-systools = "^2.0.13"
coveo-styles = "^2.1.2"
junit-xml = "*"
packaging = "*"
setuptools = "^69.2"
toml = "*"
tomlkit = "*"
importlib-resources = "^6.1.1"


[tool.poetry.dev-dependencies]
black = "22.6"
black = "24.3"
coveo-testing = "^2.0.0"
flake8 = "*"
flake8 = "^7.0.0"
isort = "*"
mypy = "0.950" # required for 3.10 support
mypy = "1.9.0"
pytest = "*"
types-setuptools = "*"
types-toml = "*"
Expand All @@ -50,7 +51,7 @@ black = true


[tool.stew.ci.custom-runners]
flake8 = { check-args = "--ignore=E501,W503,E203" }
flake8 = { check-args = "--ignore=E203,E501,E701,W503" }

[tool.stew.ci.custom-runners.isort]
check-args = ["--check", "--profile", "black", "."]
Expand Down
Empty file added test_coveo_stew/__init__.py
Empty file.
Loading