Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
Hosted Weblate 2021-06-22 00:27:16 +02:00
commit c282e69486
No known key found for this signature in database
GPG Key ID: A3FAAA06E6569B4C
2 changed files with 30 additions and 23 deletions

View File

@ -43,6 +43,10 @@ jobs:
run: |
gcc --version
python3 --version
- name: Check For setup.py
id: need-pypi
run: |
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
- name: New boards check
run: python3 -u ci_new_boards_check.py
working-directory: tools
@ -54,6 +58,11 @@ jobs:
with:
name: stubs
path: circuitpython-stubs*
- name: Install pypi dependencies
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Test Documentation Build (HTML)
run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html
- uses: actions/upload-artifact@v2
@ -108,7 +117,12 @@ jobs:
with:
name: mpy-cross.static-x64-windows
path: mpy-cross/mpy-cross.static.exe
- name: Upload stubs and mpy-cross builds to S3
- name: Upload mpy-cross builds to S3
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
env:
AWS_PAGER: ''
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-aarch64 s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-aarch64-${{ env.CP_VERSION }} --no-progress --region us-east-1
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-raspbian s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-raspbian-${{ env.CP_VERSION }} --no-progress --region us-east-1
@ -116,12 +130,16 @@ jobs:
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1
zip -9r circuitpython-stubs.zip circuitpython-stubs
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1
env:
AWS_PAGER: ''
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
- name: Upload stubs to PyPi
if: github.event_name == 'push'
env:
TWINE_USERNAME: ${{ secrets.pypi_username }}
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
echo "Uploading dev release to PyPi"
python setup.py sdist
twine upload dist/*
mpy-cross-mac:
runs-on: macos-10.15

View File

@ -8,27 +8,16 @@ from typing import Dict, List
from setuptools import setup
from pathlib import Path
import subprocess
import re
STD_PACKAGES = set(('array', 'math', 'os', 'random', 'struct', 'sys', 'ssl', 'time'))
STD_PACKAGES = set(('array', 'math', 'os', 'random', 'struct', 'sys', 'ssl', 'time'))
stub_root = Path("circuitpython-stubs")
stubs = [p.relative_to(stub_root).as_posix() for p in stub_root.glob("*.pyi")]
git_out = subprocess.check_output(["git", "describe", "--tags"])
version = git_out.strip().decode("utf-8")
# Detect a development build and mutate it to be valid semver and valid python version.
pieces = version.split("-")
if len(pieces) > 2:
# Merge the commit portion onto the commit count since the tag.
pieces[-2] += "+" + pieces[-1]
pieces.pop()
# Merge the commit count and build to the pre-release identifier.
pieces[-2] += ".dev." + pieces[-1]
pieces.pop()
version = "-".join(pieces)
def local_scheme(version):
return ""
packages = set(os.listdir("circuitpython-stubs")) - STD_PACKAGES
package_dir = dict((f"{package}-stubs", f"circuitpython-stubs/{package}")
@ -49,11 +38,11 @@ setup(
maintainer="CircuitPythonistas",
maintainer_email="circuitpython@adafruit.com",
author_email="circuitpython@adafruit.com",
version=version,
license="MIT",
packages=list(package_data.keys()),
package_data=package_data,
package_dir = package_dir,
setup_requires=["setuptools>=38.6.0"],
setup_requires=["setuptools_scm", "setuptools>=38.6.0"],
use_scm_version={"local_scheme": local_scheme},
zip_safe=False,
)