Skip to content

Commit 7c21932

Browse files
authored
Merge pull request #73 from guzman-raphael/alpha-release
Fix Publish: Utilize twine creds in pip publish, fix upload url
2 parents 9b303b2 + 81af74a commit 7c21932

File tree

5 files changed

+39
-15
lines changed

5 files changed

+39
-15
lines changed

.github/workflows/development.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ jobs:
8585
env:
8686
TWINE_USERNAME: ${{secrets.twine_username}}
8787
TWINE_PASSWORD: ${{secrets.twine_password}}
88+
outputs:
89+
release_upload_url: ${{steps.create_gh_release.outputs.upload_url}}
8890
steps:
8991
- uses: actions/checkout@v2
9092
- name: Determine package version
@@ -104,7 +106,9 @@ jobs:
104106
run: |
105107
export HOST_UID=$(id -u)
106108
docker load < "image-pharus-${PHARUS_VERSION}-py3.8-alpine.tar.gz"
107-
docker-compose -f docker-compose-build.yaml run pharus python -m twine upload dist/*
109+
docker-compose -f docker-compose-build.yaml run \
110+
-e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} pharus \
111+
sh -lc "pip install twine && python -m twine upload dist/*"
108112
- name: Get changelog entry
109113
id: changelog_reader
110114
uses: mindsers/changelog-reader-action@v2
@@ -144,7 +148,7 @@ jobs:
144148
upload_url: ${{steps.create_gh_release.outputs.upload_url}}
145149
asset_path: $${{env.PHARUS_SDIST_PATH}}
146150
asset_name: pip-pharus-${{env.PHARUS_VERSION}}.tar.gz
147-
asset_content_type: application/zip
151+
asset_content_type: application/gzip
148152
publish-images:
149153
if: github.event_name == 'push'
150154
needs: publish-release
@@ -189,7 +193,7 @@ jobs:
189193
env:
190194
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
191195
with:
192-
upload_url: ${{needs.publish-release.steps.create_gh_release.outputs.upload_url}}
196+
upload_url: ${{needs.publish-release.outputs.release_upload_url}}
193197
asset_path: "image-pharus-${{env.PHARUS_VERSION}}-py${{matrix.py_ver}}-\
194198
${{matrix.distro}}.tar.gz"
195199
asset_name: "image-pharus-${{env.PHARUS_VERSION}}-py${{matrix.py_ver}}-\

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
44

5-
## [0.1.0a1] - 2021-02-16
5+
## [0.1.0a1] - 2021-02-17
66
### Added
77
- List schemas method.
88
- List tables method.

README.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,50 @@
1111

1212
A generic REST API server backend for DataJoint pipelines built on top of `flask`, `datajoint`, and `pyjwt`.
1313

14-
Requirements:
14+
Usage and API documentation currently available within method docstrings. See Python's `help(...)` utility.
15+
16+
## Requirements for Preferred Setup
17+
1518
- [Docker](https://docs.docker.com/get-docker/ )
1619
- [Docker Compose](https://docs.docker.com/compose/install/)
1720

18-
## Run Locally
21+
## Run Locally w/ Docker
1922

2023
- Copy a `*-docker-compose.yaml` file corresponding to your usage to `docker-compose.yaml`. This file is untracked so feel free to modify as necessary.
2124
- Check the first comment which will provide best instruction on how to start the service.
2225

2326
> :warning: Deployment options currently being considered are [Docker Compose](https://docs.docker.com/compose/install/) and [Kubernetes](https://kubernetes.io/docs/tutorials/kubernetes-basics/).
2427
25-
## Run Tests for Development
28+
## Run Locally w/ Python
29+
30+
- Set environment variables for port assignment (`PHARUS_PORT`, defaults to 5000) and API route prefix (`PHARUS_PREFIX` e.g. `/api`, defaults to empty string).
31+
- For development, use CLI command `pharus`. This method supports hot-reloading so probably best coupled with `pip install -e ...`.
32+
- For production, use `gunicorn --bind 0.0.0.0:${PHARUS_PORT} pharus.server:app`.
33+
34+
## Run Tests for Development w/ Docker
2635

2736
- Create a `.env` as appropriate for your setup:
28-
```shell
29-
PY_VER=3.8 # Python version: 3.6|3.7|3.8
30-
IMAGE=djtest # Image type: djbase|djtest|djlab|djlabhub
31-
DISTRO=alpine # Distribution: alpine|debian
32-
AS_SCRIPT= # If 'TRUE', will not keep container alive but run tests and exit
33-
```
37+
```shell
38+
PY_VER=3.8 # Python version: 3.6|3.7|3.8
39+
IMAGE=djtest # Image type: djbase|djtest|djlab|djlabhub
40+
DISTRO=alpine # Distribution: alpine|debian
41+
AS_SCRIPT= # If 'TRUE', will not keep container alive but run tests and exit
42+
```
3443
- Navigate to `test-docker-compose.yaml` and check first comment which will provide best instruction on how to start the service. Yes, the command is a bit long...
3544

45+
## Run Tests for Development w/ Pytest and Flake8
46+
47+
- Set `pharus` testing environment variables:
48+
```shell
49+
PKG_DIR=/opt/conda/lib/python3.8/site-packages/pharus # path to pharus installation
50+
TEST_DB_SERVER=example.com:3306 # testing db server address
51+
TEST_DB_USER=root # testing db server user (needs CRUD on schemas, tables, users)
52+
TEST_DB_PASS=unsecure # testing db server password
53+
```
54+
- For syntax tests, run `flake8 ${PKG_DIR} --count --select=E9,F63,F7,F82 --show-source --statistics`
55+
- For pytest integration tests, run `pytest -sv --cov-report term-missing --cov=${PKG_DIR} /main/tests`
56+
- For style tests, run `flake8 ${PKG_DIR} --count --max-complexity=20 --max-line-length=95 --statistics`
57+
3658
## References
3759

3860
- DataJoint LabBook (a companion frontend)

docker-compose-build.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ services:
1313
- IMAGE
1414
volumes:
1515
- .:/main
16-
- ./requirements_package.txt:/tmp/pip_requirements.txt
1716
command:
1817
- sh
1918
- -lc

requirements_package.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)