-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:RTIInternational/teehr
- Loading branch information
Showing
8 changed files
with
110 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: test-build-publish | ||
|
||
# on: pull_request | ||
on: | ||
push: | ||
tags: [ 'v*.*.*' ] | ||
# on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
#---------------------------------------------- | ||
# check-out repo and set-up python | ||
#---------------------------------------------- | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
- name: Set up python | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
#---------------------------------------------- | ||
# ----- install & configure poetry ----- | ||
#---------------------------------------------- | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
virtualenvs-path: .venv | ||
installer-parallel: true | ||
|
||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install project | ||
run: poetry install --no-interaction | ||
#---------------------------------------------- | ||
# install JARS | ||
#---------------------------------------------- | ||
- name: Install JARs | ||
run: | | ||
source .venv/bin/activate | ||
python -m teehr.utils.install_spark_jars | ||
#---------------------------------------------- | ||
# run test suite | ||
#---------------------------------------------- | ||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
pytest tests/ | ||
# coverage report | ||
#---------------------------------------------- | ||
# build publish package | ||
#---------------------------------------------- | ||
- name: Build and publish package | ||
run: | | ||
source .venv/bin/activate | ||
poetry build | ||
poetry publish --username __token__ --password ${{ secrets.POETRY_PYPI_TOKEN_TEEHR }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,16 +28,17 @@ cd teehr_examples | |
python3 -m venv .venv | ||
source .venv/bin/activate | ||
|
||
# Install using pip. The version can be changed to install a different version. | ||
pip install 'teehr @ git+https://github.com/RTIInternational/[email protected]' | ||
# Install using pip. | ||
# Starting with version 0.4.1 TEEHR is available in PyPI | ||
pip install teehr | ||
|
||
# Download the required JAR files for Spark to interact with AWS S3. | ||
python -m teehr.utils.install_spark_jars | ||
``` | ||
Use Docker | ||
```bash | ||
$ docker build -t teehr:v0.4.1 . | ||
$ docker run -it --rm --volume $HOME:$HOME -p 8888:8888 teehr:v0.4.1 jupyter lab --ip 0.0.0.0 $HOME | ||
$ docker build -t teehr:v0.4.2 . | ||
$ docker run -it --rm --volume $HOME:$HOME -p 8888:8888 teehr:v0.4.2 jupyter lab --ip 0.0.0.0 $HOME | ||
``` | ||
|
||
## Examples | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,9 @@ TEEHR requires the following dependencies: | |
* Java 8 or later for Spark (we use 17) | ||
|
||
|
||
We do not currently push TEEHR to PyPI, so the easiest way to install it is directly from GitHub. | ||
The easiest way to install TEEHR is from PyPI using `pip`. | ||
If using `pip` to install TEEHR, we recommend installing TEEHR in a virtual environment. | ||
The code below should create a new virtual environment and install TEEHR in it. | ||
The code below creates a new virtual environment and installs TEEHR in it. | ||
|
||
.. code-block:: python | ||
|
@@ -26,8 +26,9 @@ The code below should create a new virtual environment and install TEEHR in it. | |
python3 -m venv .venv | ||
source .venv/bin/activate | ||
# Using pip. The version can be changed to install a different version. | ||
pip install 'teehr @ git+https://github.com/RTIInternational/[email protected]' | ||
# Install using pip. | ||
# Starting with version 0.4.1 TEEHR is available in PyPI | ||
pip install teehr | ||
# Download the required JAR files for Spark to interact with AWS S3. | ||
python -m teehr.utils.install_spark_jars | ||
|
@@ -36,8 +37,8 @@ Or, if you do not want to install TEEHR in your own virtual environment, you can | |
|
||
.. code-block:: bash | ||
docker build -t teehr:v0.4.1 . | ||
docker run -it --rm --volume $HOME:$HOME -p 8888:8888 teehr:v0.4.1 jupyter lab --ip 0.0.0.0 $HOME | ||
docker build -t teehr:v0.4.2 . | ||
docker run -it --rm --volume $HOME:$HOME -p 8888:8888 teehr:v0.4.2 jupyter lab --ip 0.0.0.0 $HOME | ||
Project Objectives | ||
------------------ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.4.1 | ||
0.4.2 |