Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Mar 1, 2023
2 parents fad29b2 + e554018 commit 0cd283d
Show file tree
Hide file tree
Showing 200 changed files with 5,168 additions and 3,374 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ body:
attributes:
label: Prerequisites
options:
- label: I have read [FAQ](https://github.com/yaqwsx/KiKit/blob/master/doc/faq.md)
- label: I have read [FAQ](https://yaqwsx.github.io/KiKit/latest/faq/)
required: true
- label: I use the KiKit at least 1.1.0 (older version are not supported)
- label: I use KiKit at least version 1.3.0 (older version are not supported)
required: true
- type: input
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
blank_issues_enabled: true
blank_issues_enabled: false
contact_links:
- name: Ask question
url: https://github.com/yaqwsx/KiKit/discussions/categories/q-a
Expand Down
12 changes: 12 additions & 0 deletions .github/actions/setup-kicad/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ case $1 in
sudo apt-get install --yes --no-install-recommends kicad
;;

'v7')
sudo add-apt-repository --yes ppa:kicad/kicad-7.0-releases
sudo apt-get update
sudo apt-get install --yes --no-install-recommends kicad
# The Pcbnew module is located in
# - /usr/lib/kicad/lib/python3/dist-packages
# - instead of /usr/lib/python3/dist-packages/pcbnew.py
# Let's add it to PYTHONPATH and also set LD_LIBRARY_PATH
echo "PYTHONPATH=/usr/lib/kicad/lib/python3/dist-packages:${PYTHONPATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/lib/kicad/lib/x86_64-linux-gnu/:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
;;

'nightly')
sudo add-apt-repository --yes ppa:kicad/kicad-dev-nightly
sudo apt-get update
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build documentation
on:
push:
branches:
- master
jobs:
build-doc:
name: Build upstream version documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip3 install mkdocs-material mike
- name: Setup doc deploy
run: |
git config --global user.name Documentation Bot
git config --global user.email [email protected]
- name: Build docs
run: mike deploy --push --update-aliases upstream
48 changes: 32 additions & 16 deletions .github/workflows/test-kikit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,91 @@ on:
jobs:
test:
name: "Run KiKit tests"
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
kicad-version: [v6]
kicad-version: [v6, v7, nightly]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-kicad
with:
kicad-version: ${{ matrix.kicad-version }}
- name: KiCAD version
run: python3 -c 'import pcbnew; print(pcbnew.GetBuildVersion())'
- name: Install dependencies and KiKit
run: |
sudo apt-get -qq install --yes --no-install-recommends \
zip inkscape make git libmagickwand-dev \
libgraphicsmagick1-dev libmagickcore-dev \
openscad bats
sudo python -m pip install PcbDraw
sudo python -m pip install -e .\[dev\]
sudo env PYTHONPATH=$PYTHONPATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH \
python -m pip install -e .\[dev\]
- run: make test
- run: make doc
- run: sudo make package
- run: sudo env PYTHONPATH=$PYTHONPATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH make package
build-pcm:
name: Build PCM packages
runs-on: ubuntu-20.04
needs: test
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-kicad
with:
kicad-version: v6
- name: Build PCM package
run: make pcm
- name: Upload kikit-pcm package artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: kikit-pcm
path: build/pcm-kikit
retention-days: 7
- name: Upload kikit-lib-pcm package artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: kikit-lib-pcm
path: build/pcm-kikit-lib
retention-days: 7
deploy-docker:
name: "Build and deploy Docker container"
runs-on: ubuntu-20.04
name: "Deploy nightly Docker"
runs-on: ubuntu-22.04
needs: test
if: github.ref == 'refs/heads/master' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
strategy:
matrix:
build-config:
- name: "x64"
- name: x64
suffix: ""
platform: linux/amd64
repo: ubuntu
additional_packages: ""
additional_python_packages: ""
- name: "m1"
suffix: -m1
platform: linux/arm64v8
platform: linux/arm64/v8
repo: arm64v8/ubuntu
additional_packages: gcc-aarch64-linux-gnu libgeos-dev
additional_python_packages: python3-dev
- name: "x64 v7"
suffix: "-v7"
platform: linux/amd64
repo: ubuntu
kicad_version: "7.0"
additional_packages: ""
additional_python_packages: ""
- name: "m1 v7"
suffix: -m1-v7
platform: linux/arm64/v8
repo: arm64v8/ubuntu
additional_packages: gcc-aarch64-linux-gnu
kicad_version: "7.0"
additional_packages: gcc-aarch64-linux-gnu libgeos-dev
additional_python_packages: python3-dev
steps:
- uses: actions/checkout@v2 # Required for kikit version estimation
- uses: actions/checkout@v3 # Required for kikit version estimation
with:
fetch-depth: 0 # = fetch all
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ venv
# Ignore png tab drawings
doc/resources/tabdrawing*.png

# MkDocs
site

.pc
*.epr
.pybuild

17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG REPO=ubuntu
FROM $REPO:20.04 AS base
FROM $REPO:22.04 AS base

ARG KICAD_VERSION="6.0"
ARG ADDITIONAL_PACKAGES
ARG ADDITIONAL_PYTHON_PACKAGES

Expand All @@ -11,7 +12,12 @@ RUN apt-get update && \
apt-get install -y software-properties-common $ADDITIONAL_PACKAGES && \
rm -rf /var/lib/apt/lists/*

RUN add-apt-repository --yes ppa:kicad/kicad-6.0-releases
RUN add-apt-repository --yes ppa:kicad/kicad-$KICAD_VERSION-releases

# Setup ENV variables for KiCAD 7
# See https://gitlab.com/kicad/packaging/kicad-ubuntu-builder/kicad-daily-package/-/issues/43
ENV PYTHONPATH=/usr/lib/kicad/lib/python3/dist-packages:${PYTHONPATH} \
LD_LIBRARY_PATH=/usr/lib/kicad/lib/x86_64-linux-gnu/:${LD_LIBRARY_PATH}

RUN export DEBIAN_FRONTEND="noninteractive" && apt-get -qq update && \
apt-get -qq install -y --no-install-recommends \
Expand Down Expand Up @@ -43,10 +49,11 @@ RUN python3 setup.py install
# and ignores the src directories
FROM base
COPY --from=build \
/usr/local/lib/python3.8/dist-packages \
/usr/local/lib/python3.8/dist-packages
/usr/local/lib/python3.10/dist-packages \
/usr/local/lib/python3.10/dist-packages
COPY --from=build \
/usr/local/bin \
/usr/local/bin

CMD ["bash"]
ENTRYPOINT [ "/usr/local/bin/kikit" ]
WORKDIR "/kikit"
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ deb:
deb_clean:
fakeroot debian/rules clean

doc: doc/panelization.md doc/examples.md
doc: docs/panelization/python_api.md docs/panelization/examples.md

doc/panelization.md: kikit/panelize.py scripts/panelizeDoc.py
docs/panelization/python_api.md: kikit/panelize.py scripts/panelizeDoc.py
PYTHONPATH="$(pwd):${PYTHONPATH}" python3 scripts/panelizeDoc.py > $@

doc/resources/conn.png: doc/resources/conn.kicad_pcb
pcbdraw --silent $< $@ || pcbdraw plot --silent $< $@
doc/resources/conn.png: docs/resources/conn.kicad_pcb
pcbdraw plot --silent $< $@
convert $@ -define png:include-chunk=none $@

doc/examples.md: scripts/exampleDoc.py doc/resources/conn.png
docs/panelization/examples.md: scripts/exampleDoc.py docs/resources/conn.png
PYTHONPATH="$(pwd):${PYTHONPATH}" python3 scripts/exampleDoc.py > $@

package:
Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ KiKit is a Python library, KiCAD plugin and a CLI tool to automate several
tasks in a standard KiCAD workflow like:

- panelization of both, regular and oddly shaped, boards (see
[examples](doc/examples.md))
[examples](https://yaqwsx.github.io/KiKit/latest/panelization/examples/))
- automated exporting manufacturing data based on manufacturer presets
- multi-board project in KiCAD
- building board presentation pages (see [an example presentation page generated
by KiKit](https://roboticsbrno.github.io/RB0002-BatteryPack))

![KiKit Promo](https://github.com/yaqwsx/KiKit/blob/master/doc/resources/promo.jpg?raw=true)
![KiKit Promo](https://github.com/yaqwsx/KiKit/blob/master/docs/resources/promo.jpg?raw=true)

## Do You Enjoy KiKit or Does It Save You Time?

Then definitely consider:

- [**supporting me on GitHub Sponsors**](https://github.com/sponsors/yaqwsx)
- or become my [Patreon](https://patreon.com/yaqwsx),
- or buy me a coffee: [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/E1E2181LU)
Expand All @@ -42,7 +43,7 @@ pip3 install kikit
Then you can install the Pcbnew action plugins via KiCAD's PCM.

For more detailed instructions with steps to enable GUI plugins, please see the
[installation guide](doc/installation.md).
[installation guide](https://yaqwsx.github.io/KiKit/latest/installation/intro/).

## Why Should I Use It?

Expand All @@ -69,24 +70,24 @@ manufacturing data and board presentation pages.
- compared to hand-creation of panels, your panels will pass DRC (as tracks from
different instances of the same board have distinct nets when using KiKit)
- if you have multiple boards in a single file, you can split them
- simplifying [multi-board project in KiCAD](doc/multiboard.md)
- [automated export of gerbers and assembly data](doc/fabrication.md)
- [3D printed self-registering solder paste stencils](doc/stencil.md)
- [steel stencils with alignment jig](doc/stencil.md)
- simplifying [multi-board project in KiCAD](https://yaqwsx.github.io/KiKit/latest/multiboard/)
- [automated export of gerbers and assembly data](https://yaqwsx.github.io/KiKit/latest/fabrication/intro/)
- [3D printed self-registering solder paste stencils](https://yaqwsx.github.io/KiKit/upstream/latest/#3d-printed-stencils)
- [steel stencils with alignment jig](https://yaqwsx.github.io/KiKit/latest/stencil/#steel-stencils)
- create powerfull shell scrips or Makefiles which automates your workflow...
- ...or invoke the functionality via [GUI in KiCAD](doc/plugins.md).
- ...or invoke the functionality via [GUI in KiCAD](https://yaqwsx.github.io/KiKit/latest/panelization/gui/).

## How To Use It?

Read the [CLI documentation](doc/cli.md) and the [panelize
Read the [CLI documentation](https://yaqwsx.github.io/KiKit/latest/panelization/cli/) and the [panelize
documentation](doc/panelization.md). Also don't miss the
[examples](doc/examples.md). There is also a quick not on how to use
[panelization action plugin](doc/panelizeGui.md). If you are interested in
generating solder paste stencils, see [Stencil documentation](doc/stencil.md)
[examples](https://yaqwsx.github.io/KiKit/examples/panelization/examples/). There is also a quick not on how to use
[panelization action plugin](https://yaqwsx.github.io/KiKit/latest/panelization/gui/). If you are interested in
generating solder paste stencils, see [Stencil documentation](https://yaqwsx.github.io/KiKit/latest/stencil/)

## KiKit Is Broken or Does Not Work as Expected

Please, first check [FAQ](doc/faq.md). If you have not found answer for your
Please, first check [FAQ](https://yaqwsx.github.io/KiKit/latest/faq/). If you have not found answer for your
problem there, feel free to open an issue on GitHub.

If you would like to have a feature in KiKit that is currently not on a roadmap,
Expand Down
Loading

0 comments on commit 0cd283d

Please sign in to comment.