Skip to content

Commit

Permalink
Adjustments to the scenario tooling for being in the operator repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Oct 10, 2024
1 parent d2f3b51 commit 0804fcc
Show file tree
Hide file tree
Showing 29 changed files with 283 additions and 286 deletions.
6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@

# Code reformatting with Ruff formatter
d8148ab41869f6119683cf42b7e6e574f1a99bf1

# Move ops-scenario/* to ops-scenario/testing
e77a45df2a6f3d61f4af41a202a05dbc5b4c43d9

# Merge ops-scenario into operator
eea56562abf02e2fbee44fc5851d6407e82cd6ea
9 changes: 3 additions & 6 deletions .github/workflows/build_scenario_wheels.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build ops-scenario wheels

on:
push:
Expand All @@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v3
- uses: actions/setup-python@v5

- name: Install build
run: pip install build
Expand Down Expand Up @@ -41,9 +41,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}

# - name: Setup upterm session
# uses: lhotari/action-upterm@v1

- name: upload wheel
uses: actions/upload-release-asset@v1
env:
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/scenario_quality_checks.yaml

This file was deleted.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ requires = [
]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["ops"]

[tool.setuptools.dynamic]
version = {attr = "ops.version.version"}

Expand Down Expand Up @@ -218,7 +221,7 @@ convention = "google"
builtins-ignorelist = ["id", "min", "map", "range", "type", "TimeoutError", "ConnectionError", "Warning", "input", "format"]

[tool.pyright]
include = ["ops/*.py", "ops/_private/*.py", "test/*.py", "test/charms/*/src/*.py"]
include = ["ops/*.py", "ops/_private/*.py", "test/*.py", "test/charms/*/src/*.py", "testing/src/*.py"]
pythonVersion = "3.8" # check no python > 3.8 features are used
pythonPlatform = "All"
typeCheckingMode = "strict"
Expand Down
67 changes: 8 additions & 59 deletions testing/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ version = "7.0.5"
authors = [
{ name = "Pietro Pasotti", email = "pietro.pasotti@canonical.com" }
]
maintainers = [
{ name = "The Charm Tech team at Canonical Ltd.", email = "charm-tech@lists.launchpad.net" }
]
description = "Python library providing a state-transition testing API for Operator Framework charms."
license.text = "Apache-2.0"
keywords = ["juju", "test"]

dependencies = [
"ops~=2.15",
"ops~=2.17",
"PyYAML>=6.0.1",
]
readme = "README.md"
requires-python = ">=3.8"

classifiers = [
"Development Status :: 3 - Alpha",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
'Framework :: Pytest',
'Intended Audience :: Developers',
Expand All @@ -35,69 +38,15 @@ classifiers = [
]

[project.urls]
"Homepage" = "https://github.com/canonical/ops-scenario"
"Bug Tracker" = "https://github.com/canonical/ops-scenario/issues"

[project.optional-dependencies]
docs = [
"canonical-sphinx-extensions",
"furo",
"linkify-it-py",
"myst-parser",
"pyspelling",
"sphinx ~= 8.0.0",
"sphinx-autobuild",
"sphinx-copybutton",
"sphinx-design",
"sphinx-notfound-page",
"sphinx-tabs",
"sphinxcontrib-jquery",
"sphinxext-opengraph"
]
"Homepage" = "https://github.com/canonical/operator"
"Bug Tracker" = "https://github.com/canonical/operator/issues"

[tool.setuptools.package-dir]
scenario = "scenario"


[tool.black]
include = '\.pyi?$'


[tool.ruff]
# Same as Black.
line-length = 88
indent-width = 4

# Assume Python 3.11
target-version = "py311"

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
select = ["E4", "E7", "E9", "F"]
ignore = []

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
scenario = "src"

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

[tool.isort]
profile = "black"

[bdist_wheel]
universal = 1
4 changes: 2 additions & 2 deletions testing/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ def test_base():
"""

from scenario.context import CharmEvents, Context, Manager
from scenario.errors import StateValidationError # For backwards compatibility.
from ops._private.harness import ActionFailed # For backwards compatibility.
from scenario.state import (
ActionFailed,
ActiveStatus,
Address,
AnyJson,
Expand Down Expand Up @@ -92,7 +93,6 @@ def test_base():
Resource,
Secret,
State,
StateValidationError,
Storage,
StoredState,
SubordinateRelation,
Expand Down
Loading

0 comments on commit 0804fcc

Please sign in to comment.