Skip to content

Commit

Permalink
Merge pull request ScreenPyHQ#11 from bandophahita/project_standardiz…
Browse files Browse the repository at this point in the history
…ation

Project standardization
  • Loading branch information
bandophahita authored Feb 20, 2024
2 parents 155f036 + b7c14aa commit ace946c
Show file tree
Hide file tree
Showing 18 changed files with 361 additions and 192 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
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 .
Expand Down
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/
15 changes: 0 additions & 15 deletions .pylintrc

This file was deleted.

16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

build:
os: "ubuntu-20.04"
tools:
python: "3.12"

sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2023 Perry Goy
Copyright (c) 2022-2024 Perry Goy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
35 changes: 22 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
# 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

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

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

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

.PHONY: sync update trunk_screenpy local_screenpy, requirements
.PHONY: sync update_lock_only update check

black-check:
black --check .
Expand All @@ -46,3 +36,22 @@ 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


60 changes: 23 additions & 37 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------
Expand All @@ -13,69 +12,56 @@
import os
import sys


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

from screenpy_requests.__version__ import __version__ # noqa: need the path first
from screenpy_requests.__version__ import __version__, __author__, __copyright__

autodoc_mock_imports = ["selenium", "screenpy", "screenpy_pyotp"]


# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'screenpy_requests'
copyright = '2022-2023, Perry Goy'
author = 'Perry Goy'

# The full version, including alpha/beta/rc tags
project = "screenpy_requests"
copyright = __copyright__
author = __author__
release = __version__


# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.intersphinx",
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.intersphinx",
"sphinx_rtd_theme",
"autodoc_skip_protocols",
]

intersphinx_mapping = {
"screenpy": ("https://screenpy-docs.readthedocs.io/en/latest/", None),
"requests": ("https://docs.python-requests.org/en/latest/", None),
}

autodoc_member_order = "bysource"

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

rst_prolog = """.. External references
.. |request| replace:: `Session.request <https://requests.readthedocs.io/en/master/api/#requests.Session.request>`__
.. |Requests| replace:: `Requests <https://requests.readthedocs.io/en/master/>`__
"""

# 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']
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
html_static_path = []

# -- Options for HTML output -------------------------------------------------
autodoc_member_order = "bysource"
add_module_names = False

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'default'

# 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']
# -- Options for intersphinx extension ---------------------------------------

# Other HTML settings
add_module_names = False
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"screenpy": ("https://screenpy-docs.readthedocs.io/en/latest/", None),
"requests": ("https://docs.python-requests.org/en/latest/", None),
}
1 change: 1 addition & 0 deletions docs/rtd-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-e .
1 change: 0 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
show_error_codes = True
exclude = (?x)(
setup\.py
; | tests/
| docs/
)

Expand Down
39 changes: 36 additions & 3 deletions poetry.lock

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

Loading

0 comments on commit ace946c

Please sign in to comment.