Skip to content

Commit

Permalink
Merge pull request #130 from robotpy/2021
Browse files Browse the repository at this point in the history
2021
  • Loading branch information
virtuald committed Jan 15, 2021
2 parents 181c178 + 430fe34 commit 8bc230d
Show file tree
Hide file tree
Showing 14 changed files with 184 additions and 106 deletions.
163 changes: 78 additions & 85 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
---
name: dist

on: [push, pull_request]
on:
pull_request:
push:
branches:
- main
tags:
- '*'

jobs:
check:
Expand All @@ -18,53 +24,71 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-18.04]
python_version: [3.6, 3.7, 3.8]
os: [windows-latest, macos-latest, ubuntu-18.04]
python_version: [3.6, 3.7, 3.8, 3.9]
# architecture: [x86, x64]
architecture: [x64]
exclude:
- os: macos-latest
architecture: x86
- os: ubuntu-18.04
architecture: x86

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
architecture: ${{ matrix.architecture }}

- uses: robotpy/build-actions/install-robotpy-build@v2020
- uses: robotpy/build-actions/install-build-deps@v2020
- uses: robotpy/build-actions/build-wheel@v2020
- uses: robotpy/build-actions/test-native-wheel@v2020


- uses: robotpy/build-actions/install-robotpy-build@v2021
- uses: robotpy/build-actions/install-build-deps@v2021
- uses: robotpy/build-actions/build-wheel@v2021
- uses: robotpy/build-actions/test-native-wheel@v2021

# - uses: robotpy/build-actions/validate-sphinx@v2021
# if: ${{ matrix.python_version == '3.7' && matrix.os == 'ubuntu-18.04' }}

- uses: actions/upload-artifact@v2
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
name: "dist-py${{ matrix.python_version }}-${{ matrix.os }}-${{ matrix.architecture }}"
name: "dist-${{ matrix.os }}"
path: dist

#
# Build roboRIO wheel
# Build roboRIO/raspbian wheels
#

cross-build:
runs-on: ubuntu-latest
container: robotpy/roborio-cross-ubuntu:2020.1-20.04
strategy:
matrix:
os:
- container: robotpy/roborio-cross-ubuntu:2021.3
name: roborio
# - container: robotpy/raspbian-cross-ubuntu:2021.3
# name: raspbian

container:
image: "${{ matrix.os.container }}"

steps:
- uses: actions/checkout@v2

- uses: robotpy/build-actions/install-robotpy-build@v2020
- uses: robotpy/build-actions/install-robotpy-build@v2021
with:
python: /build/venv/bin/cross-python
- uses: robotpy/build-actions/install-build-deps@v2020
- uses: robotpy/build-actions/install-build-deps@v2021
with:
python: /build/venv/bin/cross-python
wheeldir: roborio
- uses: robotpy/build-actions/build-wheel@v2020
wheeldir: ${{ matrix.os.name }}
- uses: robotpy/build-actions/build-wheel@v2021
with:
python: /build/venv/bin/cross-python

- uses: actions/upload-artifact@v2
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
name: dist-roborio
name: dist-${{ matrix.os.name }}
path: dist

#
Expand All @@ -73,38 +97,30 @@ jobs:

publish-rpyrepo:
runs-on: ubuntu-latest
needs: [check, build]
needs: [check, build, cross-build]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

steps:
- uses: actions/download-artifact@v2
with:
name: dist-py3.6-ubuntu-18.04-x64
path: dist/

- uses: actions/download-artifact@v2
with:
name: dist-py3.7-ubuntu-18.04-x64
path: dist/

- uses: actions/download-artifact@v2
with:
name: dist-py3.8-ubuntu-18.04-x64
name: dist-ubuntu-18.04
path: dist/

- uses: garygrossgarten/github-action-scp@v0.6.0
- uses: robotpy/github-action-scp@atomic
with:
local: dist
remote: public_html/2020/linux_x86_64
remote: public_html/2021/linux_x86_64
host: narya.tortall.net
username: ${{ secrets.SSH_USER }}
privateKey: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
atomicPut: true

- name: Ping readthedocs
uses: wei/curl@v1
uses: robotpy/build-actions/ping-rtd@v2021
with:
args: -X POST -d "token=${{ secrets.RTD_TOKEN }}" ${{ secrets.RTD_WEBHOOK }}
token: ${{ secrets.RTD_TOKEN }}
webhook: ${{ secrets.RTD_WEBHOOK }}

#
# RoboRIO wheel
Expand All @@ -115,75 +131,60 @@ jobs:
name: dist-roborio
path: dist-roborio/

- uses: garygrossgarten/github-action-scp@v0.6.0
- uses: robotpy/github-action-scp@atomic
with:
local: dist-roborio
remote: public_html/2020/roborio
remote: public_html/2021/roborio
host: narya.tortall.net
username: ${{ secrets.SSH_USER }}
privateKey: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
atomicPut: true

#
# Raspbian wheel
#

# - uses: actions/download-artifact@v2
# with:
# name: dist-raspbian
# path: dist-raspbian/

# - uses: robotpy/github-action-scp@atomic
# with:
# local: dist-raspbian
# remote: public_html/2021/raspbian
# host: narya.tortall.net
# username: ${{ secrets.SSH_USER }}
# privateKey: ${{ secrets.SSH_KEY }}
# passphrase: ${{ secrets.SSH_PASSPHRASE }}
# atomicPut: true


publish-pypi:
runs-on: ubuntu-latest
needs: [check, build]
needs: [check, build, cross-build]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

steps:
- uses: actions/checkout@v2

# - uses: actions/download-artifact@v2
# with:
# name: dist-py3.6-windows-latest-x86
# path: dist/

- uses: actions/download-artifact@v2
with:
name: dist-py3.6-windows-latest-x64
name: dist-windows-latest
path: dist/

# - uses: actions/download-artifact@v2
# with:
# name: dist-py3.6-macos-latest-x64
# path: dist/

# - uses: actions/download-artifact@v2
# with:
# name: dist-py3.7-windows-latest-x86
# path: dist/

- uses: actions/download-artifact@v2
with:
name: dist-py3.7-windows-latest-x64
name: dist-macos-latest
path: dist/

# - uses: actions/download-artifact@v2
# with:
# name: dist-py3.7-macos-latest-x64
# path: dist/

# - uses: actions/download-artifact@v2
# with:
# name: dist-py3.8-windows-latest-x86
# path: dist/

- uses: actions/download-artifact@v2
with:
name: dist-py3.8-windows-latest-x64
path: dist/

# - uses: actions/download-artifact@v2
# with:
# name: dist-py3.8-macos-latest-x64
# path: dist/

- uses: actions/setup-python@v2
with:
python-version: 3.8

- uses: robotpy/build-actions/install-robotpy-build@v2020
- uses: robotpy/build-actions/build-sdist@v2020
- uses: robotpy/build-actions/install-robotpy-build@v2021
- uses: robotpy/build-actions/build-sdist@v2021

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
Expand All @@ -197,14 +198,6 @@ jobs:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

steps:
- name: Get Current Tag
uses: robotpy/build-actions/get-git-tag@v2020
id: currtag

- name: Ping meta
uses: peter-evans/repository-dispatch@v1
- uses: robotpy/build-actions/ping-meta@v2021
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: robotpy/robotpy-meta
event-type: tag
client-payload: '{"package_name": "robotpy-ctre", "package_version": "${{ steps.currtag.outputs.tag }}"}'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ __pycache__/
/ctre/rpy-include
/ctre/version.py

/ctre/_simtalonsrx
/ctre/_simvictorspx

# Distribution / packaging
.Python
build/
Expand Down
Empty file added ctre/_simtalonsrx/__init__.py
Empty file.
Empty file added ctre/_simvictorspx/__init__.py
Empty file.
12 changes: 10 additions & 2 deletions docs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
# on a specific version

from setuptools import setup
import subprocess

try:
from setuptools_scm import get_version
except ImportError:
import subprocess

def get_version(*args, **kwargs):
return subprocess.check_output(["git", "describe", "--tags"], encoding="utf-8")


package = "robotpy-ctre"
version = subprocess.check_output(["git", "describe", "--tags"], encoding="utf-8")
version = get_version(root="..", relative_to=__file__)

setup(
name="dummy-package",
Expand Down
1 change: 1 addition & 0 deletions gen/BaseMotorController.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ classes:
GetSlotConfigs:
GetFilterConfigs:
GetHandle:
GetVictorSPXSimCollection:
BaseConfigAllSettings:
BaseGetAllConfigs:
BaseGetPIDConfigs:
Expand Down
1 change: 1 addition & 0 deletions gen/BaseTalon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ classes:
IsRevLimitSwitchClosed:
GetTalonSRXSensorCollection:
GetTalonFXSensorCollection:
GetTalonSRXSimCollection:
ConfigurePID:
GetPIDConfigs:
BaseTalonConfigAllSettings:
Expand Down
1 change: 1 addition & 0 deletions gen/IMotorControllerEnhanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ classes:
overloads:
FeedbackDevice, int, int:
RemoteFeedbackDevice, int, int:
ConfigSupplyCurrentLimit:
SetStatusFramePeriod:
overloads:
StatusFrame, uint8_t, int:
Expand Down
1 change: 1 addition & 0 deletions gen/Orchestra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ classes:
Pause:
Stop:
IsPlaying:
GetCurrentTime:
AddInstrument:
ClearInstruments:
1 change: 1 addition & 0 deletions gen/TalonSRX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ classes:
EnableCurrentLimit:
GetSensorCollection:
ConfigurePID:
GetSimCollection:
GetPIDConfigs:
ConfigAllSettings:
GetAllConfigs:
Expand Down
24 changes: 24 additions & 0 deletions gen/TalonSRXSimCollection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---

classes:
TalonSRXSimCollection:
shared_ptr: true
methods:
TalonSRXSimCollection:
ignore: true
SetBusVoltage:
SetSupplyCurrent:
SetStatorCurrent:
SetLimitFwd:
SetLimitRev:
SetAnalogPosition:
AddAnalogPosition:
SetAnalogVelocity:
SetPulseWidthConnected:
SetPulseWidthRiseToRiseUs:
SetPulseWidthPosition:
AddPulseWidthPosition:
SetPulseWidthVelocity:
SetQuadratureRawPosition:
AddQuadraturePosition:
SetQuadratureVelocity:
1 change: 1 addition & 0 deletions gen/VictorSPX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ classes:
GetPIDConfigs:
ConfigAllSettings:
GetAllConfigs:
GetSimCollection:
Set:
overloads:
ctre::phoenix::motorcontrol::VictorSPXControlMode, double:
Expand Down
9 changes: 9 additions & 0 deletions gen/VictorSPXSimCollection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

classes:
VictorSPXSimCollection:
shared_ptr: true
methods:
VictorSPXSimCollection:
ignore: true
SetBusVoltage:

0 comments on commit 8bc230d

Please sign in to comment.