Skip to content

Commit a97fa8d

Browse files
author
Thinh Nguyen
authored
Merge branch 'main' into master
2 parents 95f64bf + 1ba4e94 commit a97fa8d

17 files changed

+755
-591
lines changed

.github/workflow/development.yaml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Development
2+
on:
3+
pull_request:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
jobs:
8+
test-changelog:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Get changelog entry
13+
id: changelog_reader
14+
uses: guzman-raphael/changelog-reader-action@v5
15+
with:
16+
path: ./CHANGELOG.md
17+
- name: Verify changelog parsing
18+
env:
19+
TAG_NAME: ${{steps.changelog_reader.outputs.version}}
20+
RELEASE_NAME: Release ${{steps.changelog_reader.outputs.version}}
21+
BODY: ${{steps.changelog_reader.outputs.changes}}
22+
PRERELEASE: ${{steps.changelog_reader.outputs.status == 'prereleased'}}
23+
DRAFT: ${{steps.changelog_reader.outputs.status == 'unreleased'}}
24+
run: |
25+
echo "TAG_NAME=${TAG_NAME}"
26+
echo "RELEASE_NAME=${RELEASE_NAME}"
27+
echo "BODY=${BODY}"
28+
echo "PRERELEASE=${PRERELEASE}"
29+
echo "DRAFT=${DRAFT}"
30+
build:
31+
needs: test-changelog
32+
runs-on: ubuntu-latest
33+
strategy:
34+
matrix:
35+
include:
36+
- py_ver: 3.8
37+
distro: alpine
38+
image: djbase
39+
env:
40+
PY_VER: ${{matrix.py_ver}}
41+
DISTRO: ${{matrix.distro}}
42+
IMAGE: ${{matrix.image}}
43+
DOCKER_CLIENT_TIMEOUT: "120"
44+
COMPOSE_HTTP_TIMEOUT: "120"
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: Compile image
48+
run: |
49+
export PKG_NAME=$(python3 -c "print([p for p in __import__('setuptools').find_packages() if '.' not in p][0])")
50+
export PKG_VERSION=$(cat ${PKG_NAME}/version.py | awk -F\" '/__version__ = / {print $2}')
51+
export HOST_UID=$(id -u)
52+
docker-compose -f docker-compose-build.yaml up --exit-code-from element --build
53+
IMAGE=$(docker images --filter "reference=datajoint/${PKG_NAME}*" \
54+
--format "{{.Repository}}")
55+
TAG=$(docker images --filter "reference=datajoint/${PKG_NAME}*" --format "{{.Tag}}")
56+
docker save "${IMAGE}:${TAG}" | \
57+
gzip > "image-${PKG_NAME}-${PKG_VERSION}-py${PY_VER}-${DISTRO}.tar.gz"
58+
echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_ENV
59+
echo "PKG_VERSION=${PKG_VERSION}" >> $GITHUB_ENV
60+
- name: Add image artifact
61+
uses: actions/upload-artifact@v2
62+
with:
63+
name: image-${{env.PKG_NAME}}-${{env.PKG_VERSION}}-py${{matrix.py_ver}}-${{matrix.distro}}
64+
path: "image-${{env.PKG_NAME}}-${{env.PKG_VERSION}}-py${{matrix.py_ver}}-\
65+
${{matrix.distro}}.tar.gz"
66+
retention-days: 1
67+
- if: matrix.py_ver == '3.8' && matrix.distro == 'alpine'
68+
name: Add pip artifacts
69+
uses: actions/upload-artifact@v2
70+
with:
71+
name: pip-${{env.PKG_NAME}}-${{env.PKG_VERSION}}
72+
path: dist
73+
retention-days: 1
74+
publish-release:
75+
if: github.event_name == 'push'
76+
needs: build
77+
runs-on: ubuntu-latest
78+
env:
79+
TWINE_USERNAME: ${{secrets.twine_username}}
80+
TWINE_PASSWORD: ${{secrets.twine_password}}
81+
outputs:
82+
release_upload_url: ${{steps.create_gh_release.outputs.upload_url}}
83+
steps:
84+
- uses: actions/checkout@v2
85+
- name: Determine package version
86+
run: |
87+
PKG_NAME=$(python3 -c "print([p for p in __import__('setuptools').find_packages() if '.' not in p][0])")
88+
SDIST_PKG_NAME=$(echo ${PKG_NAME} | sed 's|_|-|g')
89+
PKG_VERSION=$(cat ${PKG_NAME}/version.py | awk -F\" '/__version__ = / {print $2}')
90+
echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_ENV
91+
echo "PKG_VERSION=${PKG_VERSION}" >> $GITHUB_ENV
92+
echo "SDIST_PKG_NAME=${SDIST_PKG_NAME}" >> $GITHUB_ENV
93+
- name: Get changelog entry
94+
id: changelog_reader
95+
uses: guzman-raphael/changelog-reader-action@v5
96+
with:
97+
path: ./CHANGELOG.md
98+
version: ${{env.PKG_VERSION}}
99+
- name: Create GH release
100+
id: create_gh_release
101+
uses: actions/create-release@v1
102+
env:
103+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
104+
with:
105+
tag_name: ${{steps.changelog_reader.outputs.version}}
106+
release_name: Release ${{steps.changelog_reader.outputs.version}}
107+
body: ${{steps.changelog_reader.outputs.changes}}
108+
prerelease: ${{steps.changelog_reader.outputs.status == 'prereleased'}}
109+
draft: ${{steps.changelog_reader.outputs.status == 'unreleased'}}
110+
- name: Fetch image artifact
111+
uses: actions/download-artifact@v2
112+
with:
113+
name: image-${{env.PKG_NAME}}-${{env.PKG_VERSION}}-py3.8-alpine
114+
- name: Fetch pip artifacts
115+
uses: actions/download-artifact@v2
116+
with:
117+
name: pip-${{env.PKG_NAME}}-${{env.PKG_VERSION}}
118+
path: dist
119+
- name: Publish pip release
120+
run: |
121+
export HOST_UID=$(id -u)
122+
docker load < "image-${{env.PKG_NAME}}-${PKG_VERSION}-py3.8-alpine.tar.gz"
123+
docker-compose -f docker-compose-build.yaml run \
124+
-e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} element \
125+
sh -lc "pip install twine && python -m twine upload dist/*"
126+
- name: Determine pip artifact paths
127+
run: |
128+
echo "PKG_WHEEL_PATH=$(ls dist/${PKG_NAME}-*.whl)" >> $GITHUB_ENV
129+
echo "PKG_SDIST_PATH=$(ls dist/${SDIST_PKG_NAME}-*.tar.gz)" >> $GITHUB_ENV
130+
- name: Upload pip wheel asset to release
131+
uses: actions/upload-release-asset@v1
132+
env:
133+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
134+
with:
135+
upload_url: ${{steps.create_gh_release.outputs.upload_url}}
136+
asset_path: ${{env.PKG_WHEEL_PATH}}
137+
asset_name: pip-${{env.PKG_NAME}}-${{env.PKG_VERSION}}.whl
138+
asset_content_type: application/zip
139+
- name: Upload pip sdist asset to release
140+
uses: actions/upload-release-asset@v1
141+
env:
142+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
143+
with:
144+
upload_url: ${{steps.create_gh_release.outputs.upload_url}}
145+
asset_path: ${{env.PKG_SDIST_PATH}}
146+
asset_name: pip-${{env.SDIST_PKG_NAME}}-${{env.PKG_VERSION}}.tar.gz
147+
asset_content_type: application/gzip
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: u24_element_before_release
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
workflow_dispatch:
10+
jobs:
11+
call_context_check:
12+
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main
13+
call_u24_elements_build_alpine:
14+
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_element_build.yaml@main
15+
with:
16+
py_ver: 3.9
17+
image: djbase
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: u24_element_release_call
2+
on:
3+
workflow_run:
4+
workflows: ["u24_element_tag_to_release"]
5+
types:
6+
- completed
7+
jobs:
8+
call_context_check:
9+
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main
10+
test_call_u24_elements_release_alpine:
11+
if: >-
12+
github.event.workflow_run.conclusion == 'success' && ( contains(github.event.workflow_run.head_branch, 'test') || (github.event.workflow_run.event == 'pull_request'))
13+
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_element_release.yaml@main
14+
with:
15+
py_ver: 3.9
16+
twine_repo: testpypi
17+
secrets:
18+
TWINE_USERNAME: ${{secrets.TWINE_TEST_USERNAME}}
19+
TWINE_PASSWORD: ${{secrets.TWINE_TEST_PASSWORD}}
20+
call_u24_elements_release_alpine:
21+
if: >-
22+
github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'datajoint' && !contains(github.event.workflow_run.head_branch, 'test')
23+
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_element_release.yaml@main
24+
with:
25+
py_ver: 3.9
26+
secrets:
27+
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
28+
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: u24_element_tag_to_release
2+
on:
3+
push:
4+
tags:
5+
- '*.*.*'
6+
- 'test*.*.*'
7+
jobs:
8+
call_context_check:
9+
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main
10+
call_u24_elements_build_alpine:
11+
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_element_build.yaml@main
12+
with:
13+
py_ver: 3.9
14+
image: djbase

CHANGELOG.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
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.0b0 - Unreleased
5+
## 0.1.1 - 2022-06-10
66
### Added
7-
+ First beta release
7+
+ NotImplementedError where Imported tables do not offer make function
8+
+ get_trialized_alignment_event_times docstring specificity
9+
### Changed
10+
+ Diagram to reflect design with trial.BlockTrial as imported
811

9-
+ First draft based on [Cajal](https://github.com/cajal/pipeline) and [Kavli Institute](https://github.com/kavli-ntnu/dj-docs) precursor projects
12+
## 0.1.0 - 2022-05-10
13+
### Added
14+
+ Draft based on [Cajal](https://github.com/cajal/pipeline) and [Kavli Institute](https://github.com/kavli-ntnu/dj-docs) precursor projects
15+
+ Table architecture
16+
+ AlignmentEvent design to capture windows relative to an event
17+
+ Adopted black formatting into code base

CODE_OF_CONDUCT.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
# Contributor Covenant Code of Conduct
3+
4+
## Our Pledge
5+
6+
We as members, contributors, and leaders pledge to make participation in our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, visible or invisible disability, ethnicity, sex characteristics, gender
9+
identity and expression, level of experience, education, socio-economic status,
10+
nationality, personal appearance, race, caste, color, religion, or sexual
11+
identity and orientation.
12+
13+
We pledge to act and interact in ways that contribute to an open, welcoming,
14+
diverse, inclusive, and healthy community.
15+
16+
## Our Standards
17+
18+
Examples of behavior that contributes to a positive environment for our
19+
community include:
20+
21+
* Demonstrating empathy and kindness toward other people
22+
* Being respectful of differing opinions, viewpoints, and experiences
23+
* Giving and gracefully accepting constructive feedback
24+
* Accepting responsibility and apologizing to those affected by our mistakes,
25+
and learning from the experience
26+
* Focusing on what is best not just for us as individuals, but for the overall
27+
community
28+
29+
Examples of unacceptable behavior include:
30+
31+
* The use of sexualized language or imagery, and sexual attention or advances of
32+
any kind
33+
* Trolling, insulting or derogatory comments, and personal or political attacks
34+
* Public or private harassment
35+
* Publishing others' private information, such as a physical or email address,
36+
without their explicit permission
37+
* Other conduct which could reasonably be considered inappropriate in a
38+
professional setting
39+
40+
## Enforcement Responsibilities
41+
42+
Community leaders are responsible for clarifying and enforcing our standards of
43+
acceptable behavior and will take appropriate and fair corrective action in
44+
response to any behavior that they deem inappropriate, threatening, offensive,
45+
or harmful.
46+
47+
Community leaders have the right and responsibility to remove, edit, or reject
48+
comments, commits, code, wiki edits, issues, and other contributions that are
49+
not aligned to this Code of Conduct, and will communicate reasons for moderation
50+
decisions when appropriate.
51+
52+
## Scope
53+
54+
This Code of Conduct applies within all community spaces, and also applies when
55+
an individual is officially representing the community in public spaces.
56+
Examples of representing our community include using an official e-mail address,
57+
posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event.
59+
60+
## Enforcement
61+
62+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63+
reported to the community leaders responsible for enforcement at
64+
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Correction
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A private, written warning from community leaders, providing
81+
clarity around the nature of the violation and an explanation of why the
82+
behavior was inappropriate. A public apology may be requested.
83+
84+
### 2. Warning
85+
86+
**Community Impact**: A violation through a single incident or series of
87+
actions.
88+
89+
**Consequence**: A warning with consequences for continued behavior. No
90+
interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time. This
92+
includes avoiding interactions in community spaces as well as external channels
93+
like social media. Violating these terms may lead to a temporary or permanent
94+
ban.
95+
96+
### 3. Temporary Ban
97+
98+
**Community Impact**: A serious violation of community standards, including
99+
sustained inappropriate behavior.
100+
101+
**Consequence**: A temporary ban from any sort of interaction or public
102+
communication with the community for a specified period of time. No public or
103+
private interaction with the people involved, including unsolicited interaction
104+
with those enforcing the Code of Conduct, is allowed during this period.
105+
Violating these terms may lead to a permanent ban.
106+
107+
### 4. Permanent Ban
108+
109+
**Community Impact**: Demonstrating a pattern of violation of community
110+
standards, including sustained inappropriate behavior, harassment of an
111+
individual, or aggression toward or disparagement of classes of individuals.
112+
113+
**Consequence**: A permanent ban from any sort of public interaction within the
114+
community.
115+
116+
## Attribution
117+
118+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119+
version 2.1, available at
120+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121+
122+
Community Impact Guidelines were inspired by
123+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127+
[https://www.contributor-covenant.org/translations][translations].
128+
129+
[homepage]: https://www.contributor-covenant.org
130+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131+
[Mozilla CoC]: https://github.com/mozilla/diversity
132+
[FAQ]: https://www.contributor-covenant.org/faq
133+
[translations]: https://www.contributor-covenant.org/translations

0 commit comments

Comments
 (0)