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 template #29

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
- package-ecosystem: pip
directory: /.github/workflows
schedule:
interval: monthly
- package-ecosystem: pip
directory: /docs
schedule:
interval: monthly
- package-ecosystem: pip
directory: /
schedule:
interval: monthly
versioning-strategy: lockfile-only
allow:
- dependency-type: all
24 changes: 12 additions & 12 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Github Workspace
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python Environment 3.10
- name: Set up Python Environment
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Hatch
python-version: "3.11"
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
python -m pip install -q hatch pre-commit
hatch env create
hatch --version
- name: Lint
id: lint
continue-on-error: true
run: |
echo "::add-matcher::.github/workflows/matchers/flake8.json"
hatch run lint
hatch run lint:style
echo "::remove-matcher owner=flake8::"
- name: Code Checker
id: check
- name: Type Checking
id: mypy
continue-on-error: true
run: |
echo "::add-matcher::.github/workflows/matchers/mypy.json"
hatch run check
hatch run lint:typing
echo "::remove-matcher owner=mypy::"
- name: Raise Errors For Linting Failures
if: |
steps.lint.outcome != 'success' ||
steps.check.outcome != 'success'
steps.mypy.outcome != 'success'
run: |
echo "Lint: ${{ steps.lint.outcome }}"
echo "Check: ${{ steps.check.outcome }}"
echo "Lint: ${{ steps.flake8.outcome }}"
echo "MyPy: ${{ steps.mypy.outcome }}"
exit 1
9 changes: 4 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch env create
python -m pip install -q hatch pre-commit
hatch --version
- name: Build package
run: |
hatch build
- name: Publish package on PyPI
uses: pypa/gh-action-pypi-publish@v1.6.4
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
27 changes: 14 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,33 @@ on:
branches: [main, next, beta, alpha, "*.x"]
jobs:
release:
name: Release
name: github-release
if: github.repository_owner == 'juftin'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check out the repository
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 2
ref: main
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch env create
python -m pip install -q hatch pre-commit
hatch -v env create
hatch --version
- name: Release
run: hatch run semantic-release
run: hatch run gen:release
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
GIT_AUTHOR_NAME: github-actions[bot]
Expand All @@ -44,23 +46,22 @@ jobs:
contents: write
steps:
- name: Checkout Latest Changes
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Set up Python Environment
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
hatch env create
python -m pip install -q hatch pre-commit
hatch --version
- name: Set Up GitHub Actions User
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Deploy Documentation Changes
run: hatch run docs-deploy --force
run: hatch run docs:deploy --force
9 changes: 6 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ jobs:
- { name: Python 3.10, python: "3.10" }
- { name: Python 3.9, python: "3.9" }
- { name: Python 3.8, python: "3.8" }
concurrency:
group: ${{ github.workflow }}-${{ matrix.python }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Set up Github Workspace
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python Environment ${{ matrix.python }}
Expand All @@ -39,10 +42,10 @@ jobs:
- name: Install Hatch
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch
python -m pip install -q hatch pre-commit
hatch --version
- name: Test Suite
run: |
echo "::add-matcher::.github/workflows/matchers/python.json"
hatch run +py="${{ matrix.python }}" test:matrix
hatch run +py="${{ matrix.python }}" all:cov
echo "::remove-matcher owner=python::"
50 changes: 13 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -49,7 +50,6 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -70,9 +70,10 @@ instance/

# Sphinx documentation
docs/_build/
docs/source/api
docs/source/README.md

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -83,9 +84,7 @@ profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -94,22 +93,7 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
Expand All @@ -135,28 +119,20 @@ venv.bak/
# Rope project settings
.ropeproject

# mkdocs documentation
# documentation
/site
docs/source/_autosummary

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# ruff
.ruff_cache/
# Mac Files
.DS_Store

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# Semantic Release
.github/semantic_release/node_modules/

# JetBrains IDEs
# IDE Files
.idea/

# Node.js
node_modules/
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ repos:
exclude: '\.svg$'
- id: end-of-file-fixer
- id: check-yaml
exclude: mkdocs.yaml
- id: check-ast
- id: check-docstring-first
- id: check-merge-conflict
- id: mixed-line-ending

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.8.0
rev: v2.10.0
hooks:
- id: pretty-format-toml
args: [--autofix]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: v3.0.0
hooks:
- id: prettier
args: [--print-width=88, --tab-width=4]
Expand All @@ -37,13 +38,13 @@ repos:
- id: format
name: format
description: Runs Code Auto-Formatters
entry: hatch run format
entry: hatch run lint:fmt
language: system
pass_filenames: false
- id: lint
name: lint
description: Runs Code Linters
entry: hatch run format
entry: hatch run lint:all
language: system
pass_filenames: false
require_serial: false
2 changes: 1 addition & 1 deletion .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = {
[
"@semantic-release/git",
{
assets: ["pyproject.toml", "*/_version.py"],
assets: ["pyproject.toml", "*/__about__.py"],
message:
"🔖 browsr ${nextRelease.version}\n\n${nextRelease.notes}\n[skip ci]",
},
Expand Down
20 changes: 16 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
MIT License

Copyright (c) 2023-present Justin Flannery <[email protected]>
Copyright © 2023 Justin Flannery

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion browsr/_version.py → browsr/__about__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
`browsr` version file.
browsr info file
"""

__author__ = "Justin Flannery"
Expand Down
4 changes: 2 additions & 2 deletions browsr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
browsr
"""

from .browsr import Browsr
from .universal_directory_tree import BrowsrDirectoryTree
from browsr.browsr import Browsr
from browsr.universal_directory_tree import BrowsrDirectoryTree

__all__ = ["Browsr", "BrowsrDirectoryTree"]
Loading