Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit b84709a

Browse files
authored
Merge pull request #40 from unity-sds/develop
Develop 0.1.1 to main
2 parents cb1f72c + 5ca7f5b commit b84709a

40 files changed

+3780
-1
lines changed

.github/workflows/python-app.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python Build
5+
6+
on:
7+
push:
8+
branches: [ main, develop ]
9+
pull_request:
10+
branches: [ main, develop ]
11+
12+
jobs:
13+
build:
14+
strategy:
15+
fail-fast: false
16+
max-parallel: 2
17+
matrix:
18+
python-version: [ "3.9", "3.10" ]
19+
poetry-version: [ "1.1.14" ]
20+
# os: [ ubuntu-18.04, macos-latest, windows-latest ]
21+
os: [ ubuntu-22.04, macos-latest ]
22+
runs-on: ${{ matrix.os }}
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Set up Python
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Install Poetry
30+
uses: abatilo/[email protected]
31+
with:
32+
poetry-version: ${{ matrix.poetry-version }}
33+
- name: Install dependencies
34+
run: |
35+
poetry install
36+
- name: Lint with flake8
37+
run: |
38+
# stop the build if there are Python syntax errors or undefined names
39+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
40+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
41+
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42+
- name: Test with pytest
43+
env:
44+
UNITY_USER: '${{ secrets.UNITY_TEST_USER }}'
45+
UNITY_PASSWORD: '${{ secrets.UNITY_TEST_PASSWORD }}'
46+
run: |
47+
poetry run pytest -m "not regression"
48+
- name: Regression Test with pytest
49+
env:
50+
UNITY_USER: '${{ secrets.UNITY_TEST_USER }}'
51+
UNITY_PASSWORD: '${{ secrets.UNITY_TEST_PASSWORD }}'
52+
run: |
53+
poetry run pytest -o log_cli=true --log-cli-level=DEBUG -m "regression"

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: PyPi release
2+
3+
on:
4+
push:
5+
# Pattern matched against refs/tags
6+
tags:
7+
- '*' # Push events to every tag not containing /
8+
9+
jobs:
10+
11+
release:
12+
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python 3.10
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: '3.10'
20+
- name: Install Poetry
21+
uses: abatilo/[email protected]
22+
with:
23+
poetry-version: 1.1.14
24+
- name: Install dependencies
25+
run: |
26+
poetry install
27+
- name: build
28+
run: |
29+
poetry build
30+
- name: Get version
31+
id: get-version
32+
run: |
33+
echo "::set-output name=current_version::$(poetry version | awk '{print $2}')"
34+
- name: Publish a Python distribution to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
with:
37+
user: __token__
38+
password: ${{ secrets.PYPI_API_TOKEN }}
39+
outputs:
40+
publishedVersion: ${{ steps.get-version.outputs.current_version }}
41+
verify:
42+
needs: release
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
47+
os: [ ubuntu-22.04, macos-latest, windows-latest ]
48+
runs-on: ${{ matrix.os }}
49+
steps:
50+
- name: Set up Python
51+
uses: actions/setup-python@v2
52+
with:
53+
python-version: ${{ matrix.python-version }}
54+
- name: Install with pip
55+
shell: bash
56+
run: |
57+
python -m pip install --upgrade pip
58+
59+
# Retry 3 times before the steps actually fails because sometimes it takes a minute for pip to recognize the new version
60+
(echo "pip Install Attempt: 1" && pip install --force unity_py==${{ needs.release.outputs.publishedVersion }}) || \
61+
(echo "pip Install Attempt: 2" && pip install --force unity_py==${{ needs.release.outputs.publishedVersion }}) || \
62+
(echo "pip Install Attempt: 3" && pip install --force unity_py==${{ needs.release.outputs.publishedVersion }}) || \
63+
(echo "pip Install Step Failed" && exit 1)

.gitignore

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Repo Specific
2+
tests/test_files/tmp/
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
wheels/
25+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
MANIFEST
30+
31+
# PyInstaller
32+
# Usually these files are written by a python script from a template
33+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34+
*.manifest
35+
*.spec
36+
37+
# Installer logs
38+
pip-log.txt
39+
pip-delete-this-directory.txt
40+
41+
# Unit test / coverage reports
42+
htmlcov/
43+
.tox/
44+
.nox/
45+
.coverage
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*.cover
51+
*.py,cover
52+
.hypothesis/
53+
.pytest_cache/
54+
cover/
55+
56+
# Translations
57+
*.mo
58+
*.pot
59+
60+
# Django stuff:
61+
*.log
62+
local_settings.py
63+
db.sqlite3
64+
db.sqlite3-journal
65+
66+
# Flask stuff:
67+
instance/
68+
.webassets-cache
69+
70+
# Scrapy stuff:
71+
.scrapy
72+
73+
# Sphinx documentation
74+
docs/_build/
75+
76+
# PyBuilder
77+
.pybuilder/
78+
target/
79+
80+
# Jupyter Notebook
81+
.ipynb_checkpoints
82+
83+
# IPython
84+
profile_default/
85+
ipython_config.py
86+
87+
# pyenv
88+
# For a library or package, you might want to ignore these files since the code is
89+
# intended to run in multiple environments; otherwise, check them in:
90+
# .python-version
91+
92+
# pipenv
93+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96+
# install all needed dependencies.
97+
#Pipfile.lock
98+
99+
# poetry
100+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
101+
# This is especially recommended for binary packages to ensure reproducibility, and is more
102+
# commonly ignored for libraries.
103+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
104+
#poetry.lock
105+
106+
# pdm
107+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
108+
#pdm.lock
109+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
110+
# in version control.
111+
# https://pdm.fming.dev/#use-with-ide
112+
.pdm.toml
113+
114+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115+
__pypackages__/
116+
117+
# Celery stuff
118+
celerybeat-schedule
119+
celerybeat.pid
120+
121+
# SageMath parsed files
122+
*.sage.py
123+
124+
# Environments
125+
.env
126+
.venv
127+
env/
128+
venv/
129+
ENV/
130+
env.bak/
131+
venv.bak/
132+
133+
# Spyder project settings
134+
.spyderproject
135+
.spyproject
136+
137+
# Rope project settings
138+
.ropeproject
139+
140+
# mkdocs documentation
141+
/site
142+
143+
# mypy
144+
.mypy_cache/
145+
.dmypy.json
146+
dmypy.json
147+
148+
# Pyre type checker
149+
.pyre/
150+
151+
# pytype static type analyzer
152+
.pytype/
153+
154+
# Cython debug symbols
155+
cython_debug/
156+
157+
# PyCharm
158+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160+
# and can be added to the global gitignore or merged into this file. For a more nuclear
161+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162+
.idea/

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
--------
9+
10+
## [0.1.1] - 2023-06-27
11+
12+
### Added
13+
* Added pypi repository publication to unity-py repository [[7](https://github.com/unity-sds/unity-py/issues/7)].
14+
* Added to_stac methods for writing STAC from unity-py resources (e.g. collection, dataset, datafiles)
15+
* Added from_stac methods for creating unity-py resources (e.g. collection, dataset, datafiles) from STAC files
16+
* Added capability to add files to published application catalogs
17+
* added dependency on pystac > 1.7.3 to unity-py
18+
* added addition of dataset properties to stac read/write
19+
### Fixed
20+
### Changed
21+
* all assets written out to STAC items are made relative (if they are non-URIs, relative, or exist in the same directory tree of the STAC files)
22+
### Removed
23+
* Removed support for python 3.8
24+
25+
## [0.1.0] - 2023-04-17
26+
27+
### Added
28+
29+
#### Unity-Py Updates
30+
31+
* Added Services and Classes to ecapsulate funcionality per Unity Service Area
32+
1. Process Service & Class — Deploy a process, List processes, get metadata about a processes, query jobs per process, execute a job
33+
2. Job Class — Facilitate API calls to U-SPS to monitor jobs, get job results, or dismiss jobs.
34+
3. Application Service — Courtesy of U-ADS (James and Masha) (See Application Registry below).
35+
* Mercury Dashboard Example
36+
* Miscellaneous quality of life improvements to ease code developing (type hinting, annotations, etc)
37+
38+
#### Application Registry
39+
* [unity-ads-deployment #79](https://github.com/unity-sds/unity-ads-deployment/issues/79) Add Dockstore API access to Unity.py
40+
* [unity-ads-deployment #87](https://github.com/unity-sds/unity-ads-deployment/issues/87) Convert Unity.py Application Package API to use Hosted Workflows

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
Our code of conduct is maintained at: https://unity-sds.gitbook.io/docs/get-involved/code-of-conduct

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Contributing Guide
2+
3+
Our contributing guide is maintained at: https://unity-sds.gitbook.io/docs/get-involved/contributing-guide

0 commit comments

Comments
 (0)