Implement CD with building on tags to PyPI (#34)

* Create python-publish.yml

* populated publish-analysis.yml
moved legacy versions of analysis to seperate subfolder

Signed-off-by: Arthur Lu <learthurgo@gmail.com>

* attempt to fix issue with publish action

Signed-off-by: Arthur Lu <learthurgo@gmail.com>

* another attempt o fix publish-analysis.yml

Signed-off-by: Arthur Lu <learthurgo@gmail.com>

* this should work now

Signed-off-by: Arthur Lu <learthurgo@gmail.com>

* pypa can't take just one package so i'm trying all

Signed-off-by: Arthur Lu <learthurgo@gmail.com>

* this should totally work now

Signed-off-by: Arthur Lu <learthurgo@gmail.com>

* trying removing custom dir

Signed-off-by: Arthur Lu <learthurgo@gmail.com>

* rename analysis to tra_analysis, bump version to 2.0.0

* remove old packages which are already on github releases

* remove pycache

* removed ipynb_checkpoints

Signed-off-by: Arthur Lu <learthurgo@gmail.com>

* build

* do the dir thing

* trying removing custom dir

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
Signed-off-by: Dev Singh <dev@devksingh.com>

* rename analysis to tra_analysis, bump version to 2.0.0

Signed-off-by: Dev Singh <dev@devksingh.com>

* remove old packages which are already on github releases

Signed-off-by: Dev Singh <dev@devksingh.com>

* remove pycache

Signed-off-by: Dev Singh <dev@devksingh.com>

* build

Signed-off-by: Dev Singh <dev@devksingh.com>

* removed ipynb_checkpoints

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
Signed-off-by: Dev Singh <dev@devksingh.com>

* do the dir thing

Signed-off-by: Dev Singh <dev@devksingh.com>

* Revert "do the dir thing"

This reverts commit 2eb7ffca8d.

* correct dir

* set correct yaml positions

Signed-off-by: Dev Singh <dev@devksingh.com>

* attempt to set correct dir

Signed-off-by: Dev Singh <dev@devksingh.com>

* run on tags only

Signed-off-by: Dev Singh <dev@devksingh.com>

* remove all caches from vcs

Signed-off-by: Dev Singh <dev@devksingh.com>

* bump version for testing

Signed-off-by: Dev Singh <dev@devksingh.com>

* remove broke build

Signed-off-by: Dev Singh <dev@devksingh.com>

* dont upload dists to github

Signed-off-by: Dev Singh <dev@devksingh.com>

* bump to 2.0.2 for testing

Signed-off-by: Dev Singh <dev@devksingh.com>

* fix yaml

Signed-off-by: Dev Singh <dev@devksingh.com>

* update docs

Signed-off-by: Dev Singh <dev@devksingh.com>

* add to readme

Signed-off-by: Dev Singh <dev@devksingh.com>

* run only on master

Signed-off-by: Dev Singh <dev@devksingh.com>

Co-authored-by: Arthur Lu <learthurgo@gmail.com>
Co-authored-by: Dev Singh <dsingh@CentaurusRidge.localdomain>
This commit is contained in:
Dev Singh 2020-08-10 14:29:51 -05:00 committed by GitHub
parent 35487199c4
commit 23b3966c54
27 changed files with 65 additions and 49 deletions

38
.github/workflows/publish-analysis.yml vendored Normal file
View File

@ -0,0 +1,38 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Analysis Package
on:
push:
tags:
- v*
jobs:
deploy:
runs-on: ubuntu-latest
env:
working-directory: ./analysis-master/
if: contains(github.ref, "master")
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
working-directory: ${{env.working-directory}}
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build package
working-directory: ${{env.working-directory}}
run: |
python setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: analysis-master/dist/

8
.gitignore vendored
View File

@ -30,4 +30,10 @@ data-analysis/config-pop.json
data-analysis/__pycache__/
analysis-master/__pycache__/
analysis-master/.pytest_cache/
data-analysis/.pytest_cache/
data-analysis/.pytest_cache/
analysis-master/tra_analysis.egg-info
analysis-master/tra_analysis/__pycache__
analysis-master/tra_analysis/.ipynb_checkpoints
.pytest_cache
analysis-master/tra_analysis/metrics/__pycache__
analysis-master/dist

View File

@ -1,2 +1,5 @@
# red-alliance-analysis
Titan Robotics 2022 Strategy Team Repository for Data Analysis Tools. Included with these tools are the backend data analysis engine formatted as a python package, associated binaries for the analysis package, and premade scripts that can be pulled directly from this repository and will integrate with other Red Alliance applications to quickly deploy FRC scouting tools.
# Installing
`pip install tra_analysis`

View File

@ -1,35 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"string = \"3+4+5\"\n",
"re.sub(\"\\d+[+]{1}\\d+\", string, sum([int(i) for i in re.split(\"[+]{1}\", re.search(\"\\d+[+]{1}\\d+\", string).group())]))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -7,11 +7,11 @@ with open("requirements.txt", 'r') as file:
requirements.append(line)
setuptools.setup(
name="analysis",
version="1.0.0.012",
name="tra_analysis",
version="2.0.2",
author="The Titan Scouting Team",
author_email="titanscout2022@gmail.com",
description="analysis package developed by Titan Scouting for The Red Alliance",
description="Analysis package developed by Titan Scouting for The Red Alliance",
long_description="",
long_description_content_type="text/markdown",
url="https://github.com/titanscout2022/tr2022-strategy",

View File

@ -1,5 +1,5 @@
from analysis import analysis as an
from analysis import metrics
from tra_analysis import analysis as an
from tra_analysis import metrics
def test_():
test_data_linear = [1, 3, 6, 7, 9]

View File

@ -1,16 +1,18 @@
# Titan Robotics Team 2022: Data Analysis Module
# Written by Arthur Lu & Jacob Levine
# Written by Arthur Lu, Jacob Levine, and Dev Singh
# Notes:
# this should be imported as a python module using 'from analysis import analysis'
# this should be imported as a python module using 'from tra_analysis import analysis'
# this should be included in the local directory or environment variable
# this module has been optimized for multhreaded computing
# current benchmark of optimization: 1.33 times faster
# setup:
__version__ = "1.2.2.000"
__version__ = "2.0.2"
# changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog:
2.0.2:
- rename analysis imports to tra_analysis for PyPI publishing
1.2.2.000:
- added Sort class
- added several array sorting functions to Sort class including:
@ -345,8 +347,8 @@ __all__ = [
# imports (now in alphabetical order! v 1.0.3.006):
import csv
from analysis.metrics import elo as Elo
from analysis.metrics import glicko2 as Glicko2
from tra_analysis.metrics import elo as Elo
from tra_analysis.metrics import glicko2 as Glicko2
import math
import numba
from numba import jit
@ -355,7 +357,7 @@ import scipy
from scipy import optimize, stats
import sklearn
from sklearn import preprocessing, pipeline, linear_model, metrics, cluster, decomposition, tree, neighbors, naive_bayes, svm, model_selection, ensemble
from analysis.metrics import trueskill as Trueskill
from tra_analysis.metrics import trueskill as Trueskill
import warnings
class error(ValueError):

View File

@ -1,5 +1,5 @@
# Titan Robotics Team 2022: Superscript Script
# Written by Arthur Lu & Jacob Levine
# Written by Arthur Lu, Jacob Levine, and Dev Singh
# Notes:
# setup:
@ -7,6 +7,8 @@ __version__ = "0.0.6.002"
# changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog:
0.0.6.003:
- rename analysis imports to tra_analysis for PyPI publishing
0.0.6.002:
- integrated get_team_rankings.py as get_team_metrics() function
- integrated visualize_pit.py as graph_pit_histogram() function
@ -110,7 +112,7 @@ __all__ = [
# imports:
from analysis import analysis as an
from tra_analysis import analysis as an
import data as d
import json
import numpy as np