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

Project standardization #6

Merged
merged 27 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d90db84
rearrange pyproject for easier sync between packages
bandophahita Feb 14, 2024
4940f33
sync tox.ini
bandophahita Feb 14, 2024
ca1fbd0
sync mypy.ini
bandophahita Feb 14, 2024
12d6d54
sync lint.yaml
bandophahita Feb 14, 2024
95befe4
sync poetry.yml
bandophahita Feb 14, 2024
f6535c1
sync .precommit
bandophahita Feb 14, 2024
6b5e323
sync .gitignore
bandophahita Feb 14, 2024
3cf98b3
sync __version__.py
bandophahita Feb 14, 2024
ac1dc23
avoiding https://github.com/ScreenPyHQ/screenpy_selenium/issues/36
bandophahita Feb 14, 2024
e5bbc29
adding copyright year test
bandophahita Feb 14, 2024
78414c3
sync conf.py
bandophahita Feb 15, 2024
e2f9462
setting up docs installation via pyproject.toml
bandophahita Feb 15, 2024
d6f7fcb
update lock
bandophahita Feb 15, 2024
bc5bb74
centering ascii art
bandophahita Feb 15, 2024
7c6ff43
adjusting boilerplate pyproject.toml
bandophahita Feb 15, 2024
89dc909
cleaner test format
bandophahita Feb 15, 2024
ec5d81d
adding test for license copyright year
bandophahita Feb 16, 2024
dd85833
sync conf.py
bandophahita Feb 16, 2024
882e2a9
sync pyproject.toml
bandophahita Feb 17, 2024
48c7d5a
adding protocol namespace test
bandophahita Feb 17, 2024
19b4df4
removed mapping to selenium (copy/paste oops)
bandophahita Feb 17, 2024
f4c47b1
adding test for copyright in `__init__.py`
bandophahita Feb 17, 2024
32dd66e
adding test for copyright in `__init__.py`
bandophahita Feb 19, 2024
46915f4
update lock
bandophahita Feb 19, 2024
8108b91
oops.. this was not supposed to be in the branch project_standardization
bandophahita Feb 19, 2024
34fafbb
following established pattern from the other screenpy packages
bandophahita Feb 20, 2024
6ea739b
remove test for removed functionality.
perrygoy Feb 20, 2024
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
12 changes: 5 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ jobs:
shell: bash
run: |
python -m pip install --upgrade pip
pip install -e .[dev-all]
pip install -e .[dev]
- name: Lint with black
run: |
black --check --diff screenpy_playwright
black --check --diff tests
- name: Lint with mypy
run: |
mypy screenpy_playwright
mypy tests
black --check --diff .
- name: Lint with ruff
run: |
ruff check .
- name: Lint with mypy
run: |
mypy .
2 changes: 1 addition & 1 deletion .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:

- name: Check toml structure
run: poetry check

- name: Check lock file
run: poetry lock --check
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,6 @@ dmypy.json

# Pyre type checker
.pyre/

# ruff linter
.ruff_cache/
31 changes: 16 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
exclude: 'docs'
files: '(screenpy_playwright|tests)/.*'
fail_fast: false
repos:
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
language_version: python3.12
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
hooks:
- id: ruff
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
language_version: python3.12
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
language_version: python3.12
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.0
hooks:
- id: ruff
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
language_version: python3.12

5 changes: 4 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ sphinx:

python:
install:
- requirements: docs/rtd-requirements.txt
- method: pip
path: .
extra_requirements:
- docs
39 changes: 26 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
# shortcuts to help manage flipping between branches with different dependencies
sync:
poetry install --extras dev_all --sync
poetry install --extras dev --sync

update_lock_only:
poetry update --lock

update: update_lock_only
poetry install --extras dev_all
poetry install --extras dev

check:
poetry check

requirements:
poetry export --without-hashes --with dev -f requirements.txt > requirements.txt

.PHONY: sync update_lock_only update check requirements
.PHONY: sync update_lock_only update check

black-check:
black --check .

black:
black-fix:
black .

ruff:
ruff-check:
ruff check .

ruff-fix:
Expand All @@ -31,12 +28,28 @@ ruff-fix:
mypy:
mypy .

lint: ruff mypy

.PHONY: black-check black ruff ruff-fix mypy lint
.PHONY: black-check black-fix ruff-check ruff-fix mypy

pre-check-in: black-check lint
pre-check-in: black-check ruff-check mypy

pre-check-in-fix: black ruff-fix mypy
pre-check-in-fix: black-fix ruff-fix mypy

.PHONY: pre-check-in pre-check-in-fix

# requires poetry-plugin-export
requirements:
poetry export --without-hashes --extras dev -f requirements.txt > requirements.txt

.PHONY: requirements

################################################################################
# sub-package specific

trunk_screenpy:
poetry add screenpy git+ssh://[email protected]:ScreenPyHQ/screenpy.git#trunk

local_screenpy:
pip uninstall screenpy
pip install -e ~/projects/screenpy

.PHONY: trunk_screenpy local_screenpy
36 changes: 26 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@
import os
import sys


sys.path.insert(0, os.path.abspath("./ext"))
sys.path.insert(0, os.path.abspath("../"))

from screenpy_playwright.__version__ import __version__ # noqa: need the path first
from screenpy_playwright.__version__ import (
__version__,
__author__,
__copyright__,
) # noqa: need the path first

autodoc_mock_imports = ["playwright", "screenpy", ]
autodoc_mock_imports = ["playwright", "screenpy"]


# -- Project information -----------------------------------------------------

project = 'screenpy_playwright'
copyright = '2022-2023, Perry Goy'
author = 'Perry Goy'
project = "screenpy_playwright"
copyright = __copyright__
author = __author__

# The full version, including alpha/beta/rc tags
release = __version__
Expand All @@ -50,15 +53,28 @@
"selenium": ("https://selenium-python.readthedocs.io/", None),
}

autodoc_member_order = "bysource"

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]













# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]





# -- Options for HTML output -------------------------------------------------
Expand All @@ -71,7 +87,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Other HTML settings
autodoc_member_order = "bysource"
Expand Down
4 changes: 3 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[mypy]
show_error_codes = True
exclude = (?x)(
docs/
setup\.py
| docs/
)

[mypy-screenpy_playwright.*]
disallow_untyped_defs = True

[mypy-tests.*]
disallow_untyped_defs = True
ignore_missing_imports = True
Loading
Loading