Skip to content

Commit fe7a6de

Browse files
authored
Merge pull request #7 from circuitpython/new_infrastructure_files
new infrastructure files
2 parents d43df71 + ac80b86 commit fe7a6de

28 files changed

+503
-950
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-FileCopyrightText: 2021 Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
Thank you for contributing! Before you submit a pull request, please read the following.
6+
7+
Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://docs.circuitpython.org/en/latest/docs/design_guide.html
8+
9+
If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs
10+
11+
Before submitting the pull request, make sure you've run Pylint and Black locally on your code. You can do this manually or using pre-commit. Instructions are available here: https://adafru.it/check-your-code
12+
13+
Please remove all of this text before submitting. Include an explanation or list of changes included in your PR, as well as, if applicable, a link to any related issues.

.github/workflows/build.yml

+2-71
Original file line numberDiff line numberDiff line change
@@ -10,74 +10,5 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Dump GitHub context
14-
env:
15-
GITHUB_CONTEXT: ${{ toJson(github) }}
16-
run: echo "$GITHUB_CONTEXT"
17-
- name: Translate Repo Name For Build Tools filename_prefix
18-
id: repo-name
19-
run: |
20-
echo ::set-output name=repo-name::$(
21-
echo ${{ github.repository }} |
22-
awk -F '\/' '{ print tolower($2) }' |
23-
tr '_' '-'
24-
)
25-
- name: Set up Python 3.7
26-
uses: actions/setup-python@v1
27-
with:
28-
python-version: 3.7
29-
- name: Versions
30-
run: |
31-
python3 --version
32-
- name: Checkout Current Repo
33-
uses: actions/checkout@v1
34-
with:
35-
submodules: true
36-
- name: Checkout tools repo
37-
uses: actions/checkout@v2
38-
with:
39-
repository: adafruit/actions-ci-circuitpython-libs
40-
path: actions-ci
41-
- name: Install dependencies
42-
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
43-
run: |
44-
source actions-ci/install.sh
45-
- name: Pip install pylint, Sphinx, pre-commit
46-
run: |
47-
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
48-
- name: Load graphviz
49-
run: |
50-
sudo apt install graphviz
51-
- name: Library version
52-
run: git describe --dirty --always --tags
53-
- name: Setup problem matchers
54-
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
55-
- name: Pre-commit hooks
56-
run: |
57-
pre-commit run --all-files
58-
- name: Build assets
59-
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
60-
- name: Archive bundles
61-
uses: actions/upload-artifact@v2
62-
with:
63-
name: bundles
64-
path: ${{ github.workspace }}/bundles/
65-
- name: Check For docs folder
66-
id: need-docs
67-
run: |
68-
echo ::set-output name=docs::$( find . -wholename './docs' )
69-
- name: Build docs
70-
if: contains(steps.need-docs.outputs.docs, 'docs')
71-
working-directory: docs
72-
run: sphinx-build -E -W -b html . _build/html
73-
- name: Check For setup.py
74-
id: need-pypi
75-
run: |
76-
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
77-
- name: Build Python package
78-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
79-
run: |
80-
pip install --upgrade setuptools wheel twine readme_renderer testresources
81-
python setup.py sdist
82-
python setup.py bdist_wheel --universal
83-
twine check dist/*
13+
- name: Run Build CI workflow
14+
uses: adafruit/workflows-circuitpython-libs/build@main

.github/workflows/release_gh.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: GitHub Release Actions
6+
7+
on:
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
upload-release-assets:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Run GitHub Release CI workflow
16+
uses: adafruit/workflows-circuitpython-libs/release-gh@main
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
upload-url: ${{ github.event.release.upload_url }}
20+
# TODO: If you're creating a package (library is a folder), add this
21+
# argument along with the prefix (or full name) of the package folder
22+
# so the MPY bundles are built correctly:s
23+
# package-prefix: displayio_cartesian

.github/workflows/release_pypi.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: PyPI Release Actions
6+
7+
on:
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
upload-release-assets:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Run PyPI Release CI workflow
16+
uses: adafruit/workflows-circuitpython-libs/release-pypi@main
17+
with:
18+
pypi-username: ${{ secrets.pypi_username }}
19+
pypi-password: ${{ secrets.pypi_password }}

.gitignore

+40-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,48 @@
1-
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries
22
#
3-
# SPDX-License-Identifier: Unlicense
3+
# SPDX-License-Identifier: MIT
44

5+
# Do not include files and directories created by your personal work environment, such as the IDE
6+
# you use, except for those already listed here. Pull requests including changes to this file will
7+
# not be accepted.
8+
9+
# This .gitignore file contains rules for files generated by working with CircuitPython libraries,
10+
# including building Sphinx, testing with pip, and creating a virual environment, as well as the
11+
# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs.
12+
13+
# If you find that there are files being generated on your machine that should not be included in
14+
# your git commit, you should create a .gitignore_global file on your computer to include the
15+
# files created by your personal setup. To do so, follow the two steps below.
16+
17+
# First, create a file called .gitignore_global somewhere convenient for you, and add rules for
18+
# the files you want to exclude from git commits.
19+
20+
# Second, configure Git to use the exclude file for all Git repositories by running the
21+
# following via commandline, replacing "path/to/your/" with the actual path to your newly created
22+
# .gitignore_global file:
23+
# git config --global core.excludesfile path/to/your/.gitignore_global
24+
25+
# CircuitPython-specific files
526
*.mpy
6-
.idea
27+
28+
# Python-specific files
729
__pycache__
8-
_build
930
*.pyc
31+
32+
# Sphinx build-specific files
33+
_build
34+
35+
# This file results from running `pip -e install .` in a local repository
36+
*.egg-info
37+
38+
# Virtual environment-specific files
1039
.env
11-
.python-version
12-
build*/
13-
bundles
40+
.venv
41+
42+
# MacOS-specific files
1443
*.DS_Store
15-
.eggs
16-
dist
17-
**/*.egg-info
44+
45+
# IDE-specific files
46+
.idea
1847
.vscode
48+
*~

.pre-commit-config.yaml

+14-33
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,21 @@
1-
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
1+
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
22
#
33
# SPDX-License-Identifier: Unlicense
44

55
repos:
6-
- repo: https://github.com/python/black
7-
rev: 20.8b1
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.5.0
88
hooks:
9-
- id: black
10-
- repo: https://github.com/fsfe/reuse-tool
11-
rev: v0.12.1
9+
- id: check-yaml
10+
- id: end-of-file-fixer
11+
- id: trailing-whitespace
12+
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
rev: v0.3.4
1214
hooks:
13-
- id: reuse
14-
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v2.3.0
15+
- id: ruff-format
16+
- id: ruff
17+
args: ["--fix"]
18+
- repo: https://github.com/fsfe/reuse-tool
19+
rev: v3.0.1
1620
hooks:
17-
- id: check-yaml
18-
- id: end-of-file-fixer
19-
- id: trailing-whitespace
20-
- repo: https://github.com/pycqa/pylint
21-
rev: pylint-2.7.1
22-
hooks:
23-
- id: pylint
24-
name: pylint (library code)
25-
types: [python]
26-
exclude: "^(docs/|examples/|tests/|setup.py$)"
27-
- repo: local
28-
hooks:
29-
- id: pylint_examples
30-
name: pylint (examples code)
31-
description: Run pylint rules on "examples/*.py" files
32-
entry: /usr/bin/env bash -c
33-
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']
34-
language: system
35-
- id: pylint_tests
36-
name: pylint (tests code)
37-
description: Run pylint rules on "tests/*.py" files
38-
entry: /usr/bin/env bash -c
39-
args: ['([[ ! -d "tests" ]] || for test in $(find . -path "./tests/*.py"); do pylint --disable=missing-docstring $test; done)']
40-
language: system
21+
- id: reuse

0 commit comments

Comments
 (0)