Skip to content

Commit

Permalink
Merge pull request #178 from jacebrowning/python-3.13
Browse files Browse the repository at this point in the history
Add support for Python 3.13
  • Loading branch information
jacebrowning authored Jan 15, 2025
2 parents 5d1382a + 8d2802b commit 5595c2e
Show file tree
Hide file tree
Showing 9 changed files with 606 additions and 321 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 1 addition & 7 deletions .pylint.ini
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ disable=
unsubscriptable-object,
singleton-comparison,
subprocess-run-check,
invalid-field-call,

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -409,10 +410,3 @@ known-standard-library=

# Force import order to recognize a module as part of a third party library.
known-third-party=enchant


[EXCEPTIONS]

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python 3.11.10
python 3.13.1
poetry 1.8.5
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,31 @@
"ipython",
"isort",
"linebreak",
"macfsevents",
"mkdocs",
"mockbrowser",
"mockelement",
"mockhtml",
"multidict",
"mypy",
"noninteractive",
"overgeneral",
"pipx",
"pluginmanager",
"proto",
"pydocstyle",
"pyenv",
"pygments",
"pyinstaller",
"pync",
"pyyaml",
"setenv",
"showfspath",
"startfile",
"tlsv",
"useragent",
"USERPROFILE",
"yarl",
"zipcodes"
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Install this library directly into an activated virtual environment:
pip install pomace
```

or add it to your [Poetry](https://poetry.eustace.io/) project:
or add it to your [Poetry](https://python-poetry.org/docs/) project:

```shell
poetry add pomace
Expand Down
867 changes: 578 additions & 289 deletions poetry.lock

Large diffs are not rendered by default.

17 changes: 7 additions & 10 deletions pomace/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ def find(self) -> Optional[WebDriverElement]:
except ElementDoesNotExist:
log.debug(f"{self} unable to find element")
return None
else:
self.index = index
html = (
element.outer_html.replace("\n", "").replace("\t", "").replace(" ", "")
)
log.debug(f"{self} found element: {html}")
return element

self.index = index
html = element.outer_html.replace("\n", "").replace("\t", "").replace(" ", "")
log.debug(f"{self} found element: {html}")
return element

def score(self, value: int, *, limit: int = 0) -> bool:
previous = self.uses
Expand Down Expand Up @@ -209,9 +207,8 @@ def _perform_action(self, function: Callable, *args, **kwargs) -> bool:
except WebDriverException as e:
log.debug(e)
return False
else:
self._verb.post_action(previous_url, delay, wait, start)
return True
self._verb.post_action(previous_url, delay, wait, start)
return True

def clean(self, page, *, force: bool = False) -> int:
unused_locators = []
Expand Down
13 changes: 5 additions & 8 deletions pomace/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def is_identifier(value: str) -> bool:
UUID(value)
except ValueError:
return False
else:
return True
return True


class URL:
Expand Down Expand Up @@ -196,9 +195,8 @@ def __getattr__(self, name):
alias = ALIASES[name]
except KeyError:
return super().__getattribute__(name)
else:
log.debug(f"Mapped fake attribute {alias!r} to {name!r}")
return getattr(self, alias)
log.debug(f"Mapped fake attribute {alias!r} to {name!r}")
return getattr(self, alias)

@property
def name(self) -> str:
Expand Down Expand Up @@ -227,9 +225,8 @@ def __getattr__(self, name):
alias = ALIASES[name]
except KeyError:
return super().__getattribute__(name)
else:
log.debug(f"Mapped fake attribute {alias!r} to {name!r}")
method = getattr(self._generator, alias)
log.debug(f"Mapped fake attribute {alias!r} to {name!r}")
method = getattr(self._generator, alias)
return method()

@property
Expand Down
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]

name = "pomace"
version = "0.12.8"
version = "0.12.9"
description = "Dynamic page objects for browser automation."

license = "MIT"
Expand Down Expand Up @@ -32,6 +32,8 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet :: WWW/HTTP :: Browsers",
"Topic :: Software Development :: Testing",
]
Expand All @@ -55,7 +57,7 @@ splinter = "^0.21"
webdriver_manager = "^4.0.2"

# Persistence
datafiles = "^2.2.3"
datafiles = "^2.3"
gitman = "^3.5.2"
parse = "^1.14"

Expand All @@ -81,7 +83,7 @@ isort = "^5.10"
mypy = "^1.3"
types-requests = "*"
pydocstyle = "*"
pylint = "~2.15"
pylint = "~3.3"

# Testing
pytest = "^7.3"
Expand All @@ -103,7 +105,7 @@ pygments = "^2.15"
# Tooling
pyinstaller = "*"
sniffer = "*"
MacFSEvents = { version = "*", platform = "darwin" }
macfsevents = { version = "*", platform = "darwin", markers = "python_version < '3.13'" }
pync = { version = "*", platform = "darwin" }
rope = "*"

Expand Down

0 comments on commit 5595c2e

Please sign in to comment.