Skip to content

Commit

Permalink
Lint the yaml and add to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Nov 8, 2023
1 parent a757e66 commit 3d938a9
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 72 deletions.
22 changes: 11 additions & 11 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
# These are supported funding model platforms

github: [pydanny]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
24 changes: 11 additions & 13 deletions .github/workflows/contributing.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
---
name: Contributing

on:
push:
branches:
- main

push:
branches: [main]
jobs:
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
steps:
- name: Contribute List
uses: akhilmhdh/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
steps:
- name: Contribute List
uses: akhilmhdh/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
11 changes: 4 additions & 7 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
---
name: CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -22,8 +19,8 @@ jobs:
pip install '.[dev]'
- name: Lint with ruff and black
run: |
# stop the build if there are Python syntax errors or undefined names
# stop the build if there are linting errors
make lint
- name: Test with pytest
run: |
run: |-
pytest
39 changes: 17 additions & 22 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
---
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Publish Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
11 changes: 4 additions & 7 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.10"
python: '3.10'
jobs:
pre_build:
- "pip install '.[dev]'"
- "mkdocs build"

pre_build: ["pip install '.[dev]'", mkdocs build]
mkdocs:
configuration: mkdocs.yml
fail_on_warning: false
fail_on_warning: false
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ changelog: # Install gh cli and jq first
format:
black .
ruff check . --fix
yamlfix .

lint:
black .
ruff check .
yamlfix .

mypy:
mypy .
Expand Down
15 changes: 4 additions & 11 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
site_name: dj-notebook
repo_url: https://github.com/pydanny/dj-notebook
theme:
Expand All @@ -11,17 +12,14 @@ theme:
logo: img/dj-notebook-logo.png
icon:
repo: fontawesome/brands/github

markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.superfences

plugins:
- mkdocs-jupyter:
remove_tag_config:
remove_input_tags:
- hide_code
remove_input_tags: [hide_code]
- include-markdown:
start: <!--start-->
end: <!--end-->
Expand All @@ -31,8 +29,7 @@ plugins:
handlers:
python:
options:
extensions:
- griffe_typingdoc
extensions: [griffe_typingdoc]
show_root_heading: true
show_if_no_docstring: true
inherited_members: true
Expand All @@ -44,18 +41,14 @@ plugins:
signature_crossrefs: true
show_symbol_type_heading: true
show_symbol_type_toc: true


nav:
- Introduction: index.md
- Installation:
- Installation: installation.md
- Using with PyCharm: pycharm.md
- Activation: activation.md
- Usage: usage.ipynb
- Reference (Code API):
- reference/index.md
- reference/plus.md
- Reference (Code API): [reference/index.md, reference/plus.md]
- Contributing: contributing.md
- Releasing: releasing.md
- Changelog: changelog.md
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ dev = [
"mkdocstrings[python]>=0.18",
"mypy", # linting
"pytest", # testing
"ruff" # linting
"ruff", # linting
"yamlfix" # fixing the YAML
]

[project.urls]
Expand Down

0 comments on commit 3d938a9

Please sign in to comment.