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

Fixed mkdocsignore and improved DevExp #24

Merged
merged 48 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
69fc024
test
DariuszPorowski Mar 31, 2023
c525e0f
Install Poetry
DariuszPorowski Mar 31, 2023
0319184
ruff temp off
DariuszPorowski Mar 31, 2023
6b19184
Update workflow.ci.yml
DariuszPorowski Apr 5, 2023
0ca0cd4
test pre-commit
DariuszPorowski Apr 5, 2023
2886cea
bandit
DariuszPorowski Apr 5, 2023
fc46707
tool.poetry.virtualenvs
DariuszPorowski Apr 5, 2023
9fdf6de
venvs
DariuszPorowski Apr 5, 2023
181ff48
types
DariuszPorowski Apr 5, 2023
8975f09
NavigationItem None type
DariuszPorowski Apr 5, 2023
0c40508
evaluate_nav
DariuszPorowski Apr 5, 2023
dc28406
[pip dev] (deps-dev): Bump pre-commit from 3.2.1 to 3.2.2 (#25)
dependabot[bot] Apr 5, 2023
cc2ebde
[pip dev] (deps-dev): Bump mkdocs-material from 9.1.4 to 9.1.5 (#23)
dependabot[bot] Apr 5, 2023
25ece67
nav test
DariuszPorowski Apr 5, 2023
357de30
nav
DariuszPorowski Apr 5, 2023
5ed7850
nav back
DariuszPorowski Apr 5, 2023
ccd7c99
.
DariuszPorowski Apr 5, 2023
a1d56c5
.
DariuszPorowski Apr 5, 2023
8d5b443
.
DariuszPorowski Apr 5, 2023
0ec612d
enabled: false
DariuszPorowski Apr 5, 2023
5a2dd1f
.
DariuszPorowski Apr 5, 2023
8ea2536
mkdocs-exclude-unused-files
DariuszPorowski Apr 5, 2023
01a97dd
.
DariuszPorowski Apr 5, 2023
c2dec12
.
DariuszPorowski Apr 5, 2023
6a98b3b
.
DariuszPorowski Apr 6, 2023
0d42aa6
all-extras
DariuszPorowski Apr 6, 2023
881033f
.
DariuszPorowski Apr 6, 2023
c74cfb8
.
DariuszPorowski Apr 6, 2023
3f34456
.
DariuszPorowski Apr 6, 2023
0affe3d
.
DariuszPorowski Apr 6, 2023
49ed210
.
DariuszPorowski Apr 6, 2023
10d4692
.
DariuszPorowski Apr 6, 2023
bccc97c
vcs = "git"
DariuszPorowski Apr 6, 2023
84c9195
.
DariuszPorowski Apr 6, 2023
83b24dc
.
DariuszPorowski Apr 6, 2023
150ab67
.
DariuszPorowski Apr 6, 2023
8a406b1
.
DariuszPorowski Apr 6, 2023
a6f9ad8
.
DariuszPorowski Apr 6, 2023
2712137
.
DariuszPorowski Apr 6, 2023
cc424a9
.
DariuszPorowski Apr 6, 2023
c4a16ce
.
DariuszPorowski Apr 6, 2023
b15d8c3
[pip dev] (deps-dev): Bump pre-commit from 3.2.1 to 3.2.2 (#26)
dependabot[bot] Apr 6, 2023
7148f81
[pip dev] (deps-dev): Bump mkdocs-material from 9.1.4 to 9.1.5 (#27)
dependabot[bot] Apr 6, 2023
cc658f4
.
DariuszPorowski Apr 6, 2023
0889632
.mkdocsignore fix
DariuszPorowski Apr 7, 2023
8831187
3rd party plugins compatibility
DariuszPorowski Apr 7, 2023
338a9e6
gitignore
DariuszPorowski Apr 7, 2023
1a45a8f
tagging
DariuszPorowski Apr 7, 2023
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
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.isort",
"yzhang.markdown-all-in-one"
"yzhang.markdown-all-in-one",
"charliermarsh.ruff"
]
}
}
Expand Down
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 2

[*.{cmd,bat}]
end_of_line = crlf

[*.{yml,yaml,pages,md,markdown}]
indent_style = space
indent_size = 2

[*.py]
indent_style = space
indent_size = 4

[*.json]
indent_size = 2
26 changes: 18 additions & 8 deletions .file-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@
# include_glob:
# - "test/test.md"
# - "**/draft-*.md"
# exclude_glob:
# - "Contributions/**"
# include_tag:
# - foo
# - "#bar"
# exclude_tag:
# - test
# - "#bar"

only_doc_pages: true # default value is false
exclude_regex:
- '.*\.md$'
include_regex:
- "tags.md"
# INCLUDE ONLY DOC TAGED WITH 'released'
# only_doc_pages: true
# exclude_regex:
# - '.*\.md$'
# include_tag:
# - released

only_doc_pages: true
mkdocsignore: true
exclude_glob:
- "**/draft-*.md"
- "**/preview-*.md"
include_tag:
- released
- public preview
exclude_tag:
- draft
include_regex:
- "tags.md"
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
max-line-length = 88
max-line-length = 120
exclude = .git,__pycache__,.tox,.eggs,*.egg,.venv
103 changes: 80 additions & 23 deletions .github/workflows/workflow.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,30 @@ on:

# Allow one concurrent
concurrency:
group: pr-${{ github.ref }}
group: ${{ format('{0}-{1}', github.event_name, github.ref) }}
cancel-in-progress: true

permissions:
contents: read

jobs:
dependency-review:
if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
name: Dependency Review
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Run Dependency Review
uses: actions/dependency-review-action@v3
with:
comment-summary-in-pr: true

lint:
if: ${{ !github.event.pull_request.draft }}
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && !github.event.pull_request.draft) }}
name: Lint
runs-on: ubuntu-latest
steps:
Expand All @@ -39,29 +57,41 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
python-version-file: .python-version
cache: poetry

- name: Install dependencies
run: poetry install --verbose --only=dev
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
poetry install --verbose --all-extras --only=dev

# - name: Run ruff
# run: poetry run ruff -v check .

- name: Check imports sort
run: poetry run isort --profile black --check-only .
- name: Run mypy
run: poetry run mypy --config-file pyproject.toml

- name: Check formatting
run: poetry run black --check .
- name: Run isort
run: poetry run isort --settings-path pyproject.toml --check-only .

- name: Check formatting
- name: Run black
run: poetry run black --config pyproject.toml --check .

- name: Run flake8
run: poetry run flake8 --count .

test:
if: ${{ !github.event.pull_request.draft }}
name: Test
needs: lint
- name: Run bandit
run: poetry run bandit --configfile pyproject.toml --recursive .

test-self:
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && !github.event.pull_request.draft) }}
name: Test (self)
needs:
- lint
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -75,18 +105,45 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
cache: poetry

- name: Install dependencies
run: poetry install --verbose
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
poetry install --verbose --without=dev

- name: Test Build
run: |
poetry version --verbose
poetry build --verbose
run: poetry build --verbose

- name: Test MkDocs build
run: poetry run mkdocs build --verbose

test-plugins:
if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
name: Test (plugins)
needs:
- test-self
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Install Poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version-file: .python-version
cache: poetry

- name: Install dependencies
run: |
pip uninstall -y mkdocs_file_filter_plugin
pip install dist/mkdocs_file_filter_plugin-0.0.1.tar.gz
poetry run mkdocs build --verbose
poetry self add "poetry-dynamic-versioning[plugin]"
poetry install --verbose --without=dev

- name: Test Build
run: poetry build --verbose

- name: Test MkDocs build
run: poetry run mkdocs build --verbose --config-file mkdocs.plugins.yml
2 changes: 1 addition & 1 deletion .github/workflows/workflow.release.draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: release-drafter/release-drafter@v5
id: release-drafter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}

- name: Release URL
run: |
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/workflow.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
python-version: .python-version
cache: poetry

- name: Install dependencies
run: poetry install --verbose
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
poetry install --verbose --without=dev

- name: Set Version
run: poetry version ${GITHUB_REF_NAME/v/}
# - name: Set Version
# run: poetry version ${GITHUB_REF_NAME/v/}

- name: Build
run: poetry build --verbose
Expand Down
19 changes: 11 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ profile_default/
ipython_config.py

# pyenv
.python-version
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -108,13 +108,13 @@ celerybeat.pid
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# .env
# .venv
# env/
# venv/
# ENV/
# env.bak/
# venv.bak/

# Spyder project settings
.spyderproject
Expand All @@ -133,3 +133,6 @@ dmypy.json

# Pyre type checker
.pyre/

# Ruff cache
.ruff_cache
2 changes: 1 addition & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ignore_front_matter": true,
"MD013": false
}
}
1 change: 0 additions & 1 deletion .mkdocsignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# MkDocs
# docs/test/**
docs/**/draft-*.md
74 changes: 64 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,72 @@
default_language_version:
python: python3.10

default_stages: [commit, push]

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- id: trailing-whitespace
- id: end-of-file-fixer
# - id: check-yaml
# - id: check-json
- id: check-toml
- id: debug-statements
- id: no-commit-to-branch

- repo: local
hooks:
- id: pyupgrade
name: pyupgrade
entry: poetry run pyupgrade --py38-plus
types: [python]
language: system

- repo: local
hooks:
- id: mypy
name: mypy
entry: poetry run mypy --config-file pyproject.toml
types: [python]
language: system

- repo: local
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
name: isort
entry: poetry run isort --settings-path pyproject.toml
types: [python]
language: system

- repo: local
hooks:
- id: black
name: black
entry: poetry run black --config pyproject.toml
types: [python]
language: system

- repo: local
hooks:
- id: flake8
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
name: flake8
entry: poetry run flake8
types: [python]
language: system

- repo: local
hooks:
- id: bandit
name: bandit
entry: poetry run bandit --configfile pyproject.toml --recursive
types: [python]
language: system

- repo: local
hooks:
- id: ruff
name: ruff
entry: poetry run ruff
types: [python]
language: system
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
"recommendations": [
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
"EditorConfig.EditorConfig",
"GitHub.vscode-pull-request-github",
"ms-vscode-remote.vscode-remote-extensionpack",
"ms-vscode-remote.remote-containers",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.isort",
"yzhang.markdown-all-in-one"
"yzhang.markdown-all-in-one",
"charliermarsh.ruff"
]
}
Loading