Skip to content

Commit 9afcf24

Browse files
authored
Merge pull request #94 from guzman-raphael/docs
Add automated documentation
2 parents 8afc4d1 + 7d4ec07 commit 9afcf24

28 files changed

+1295
-348
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Contribution Guidelines
2+
3+
This project follows the [DataJoint Contribution Guidelines](https://docs.datajoint.io/python/community/02-Contribute.html). Please reference the link for more full details.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
## Bug Report
11+
12+
### Description
13+
A clear and concise description of what is the overall operation that is intended to be performed that resulted in an error.
14+
15+
### Reproducibility
16+
Include:
17+
- OS (WIN | MACOS | Linux)
18+
- Pharus Version
19+
- MySQL Version
20+
- MySQL Deployment Strategy (local-native | local-docker | remote)
21+
- Minimum number of steps to reliably reproduce the issue
22+
- Complete error stack as a result of evaluating the above steps
23+
24+
### Expected Behavior
25+
A clear and concise description of what you expected to happen.
26+
27+
### Screenshots
28+
If applicable, add screenshots to help explain your problem.
29+
30+
### Additional Research and Context
31+
Add any additional research or context that was conducted in creating this report.
32+
33+
For example:
34+
- Related GitHub issues and PR's either within this repository or in other relevant repositories.
35+
- Specific links to specific lines or a focus within source code.
36+
- Relevant summary of Maintainers development meetings, milestones, projects, etc.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: DataJoint Contribution Guideline
4+
url: https://docs.datajoint.io/python/community/02-Contribute.html
5+
about: Please make sure to review the DataJoint Contribution Guideline
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for a new feature
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
## Feature Request
11+
12+
### Problem
13+
A clear and concise description how this idea has manifested and the context. Elaborate on the need for this feature and/or what could be improved. Ex. I'm always frustrated when [...]
14+
15+
### Requirements
16+
A clear and concise description of the requirements to satisfy the new feature. Detail what you expect from a successful implementation of the feature. Ex. When using this feature, it should [...]
17+
18+
### Justification
19+
Provide the key benefits in making this a supported feature. Ex. Adding support for this feature would ensure [...]
20+
21+
### Alternative Considerations
22+
Do you currently have a work-around for this? Provide any alternative solutions or features you've considered.
23+
24+
### Related Errors
25+
Add any errors as a direct result of not exposing this feature.
26+
27+
Please include steps to reproduce provided errors as follows:
28+
- OS (WIN | MACOS | Linux)
29+
- Pharus Version
30+
- MySQL Version
31+
- MySQL Deployment Strategy (local-native | local-docker | remote)
32+
- Minimum number of steps to reliably reproduce the issue
33+
- Complete error stack as a result of evaluating the above steps
34+
35+
### Screenshots
36+
If applicable, add screenshots to help explain your feature.
37+
38+
### Additional Research and Context
39+
Add any additional research or context that was conducted in creating this feature request.
40+
41+
For example:
42+
- Related GitHub issues and PR's either within this repository or in other relevant repositories.
43+
- Specific links to specific lines or a focus within source code.
44+
- Relevant summary of Maintainers development meetings, milestones, projects, etc.
45+
- Any additional supplemental web references or links that would further justify this feature request.

.github/workflows/development.yaml

Lines changed: 71 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,29 @@ jobs:
2727
echo "BODY=${BODY}"
2828
echo "PRERELEASE=${PRERELEASE}"
2929
echo "DRAFT=${DRAFT}"
30+
build-docs:
31+
needs: test-changelog
32+
runs-on: ubuntu-latest
33+
env:
34+
DOCKER_CLIENT_TIMEOUT: "120"
35+
COMPOSE_HTTP_TIMEOUT: "120"
36+
PY_VER: "3.8"
37+
IMAGE: "djtest"
38+
DISTRO: "alpine"
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Compile docs static artifacts
42+
run: |
43+
export PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\' '{print $2}')
44+
export HOST_UID=$(id -u)
45+
docker-compose -f docker-compose-docs.yaml up --exit-code-from pharus --build
46+
echo "PHARUS_VERSION=${PHARUS_VERSION}" >> $GITHUB_ENV
47+
- name: Add docs static artifacts
48+
uses: actions/upload-artifact@v2
49+
with:
50+
name: docs-static-pharus-${{env.PHARUS_VERSION}}
51+
path: docs/_build/html
52+
retention-days: 1
3053
build:
3154
needs: test-changelog
3255
runs-on: ubuntu-latest
@@ -220,39 +243,51 @@ jobs:
220243
asset_name: "image-pharus-${{env.PHARUS_VERSION}}-py${{matrix.py_ver}}-\
221244
${{matrix.distro}}.tar.gz"
222245
asset_content_type: application/gzip
223-
# publish-docs:
224-
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
225-
# runs-on: ubuntu-latest
226-
# steps:
227-
# - uses: actions/checkout@v1
228-
# - name: Build docs
229-
# uses: ammaraskar/sphinx-action@master
230-
# with:
231-
# docs-folder: "docs/"
232-
# # - name: Upload docs artifact
233-
# # uses: actions/upload-artifact@v1
234-
# # with:
235-
# # name: docs-html
236-
# # path: docs/_build/html/
237-
# # retention-days: 1
238-
# - name: Commit documentation changes
239-
# run: |
240-
# git clone https://github.com/${GITHUB_REPOSITORY}.git \
241-
# --branch gh-pages --single-branch gh-pages
242-
# rm -R gh-pages/*
243-
# cp -r docs/_build/html/* gh-pages/
244-
# cp .gitignore gh-pages/
245-
# touch gh-pages/.nojekyll
246-
# cd gh-pages
247-
# git config --local user.email "[email protected]"
248-
# git config --local user.name "GitHub Action"
249-
# git add . --all
250-
# git commit -m "Update documentation" -a || true
251-
# # The above command will fail if no changes were present, so we ignore
252-
# # the return code.
253-
# - name: Push changes
254-
# uses: ad-m/github-push-action@master
255-
# with:
256-
# branch: gh-pages
257-
# directory: gh-pages
258-
# github_token: ${{secrets.GITHUB_TOKEN}}
246+
publish-docs:
247+
if: github.event_name == 'push'
248+
needs: publish-release
249+
runs-on: ubuntu-latest
250+
steps:
251+
- uses: actions/checkout@v2
252+
- name: Determine package version
253+
run: |
254+
PHARUS_VERSION=$(cat pharus/version.py | tail -1 | awk -F\' '{print $2}')
255+
echo "PHARUS_VERSION=${PHARUS_VERSION}" >> $GITHUB_ENV
256+
- name: Fetch docs static artifacts
257+
uses: actions/download-artifact@v2
258+
with:
259+
name: docs-static-pharus-${{env.PHARUS_VERSION}}
260+
path: docs/_build/html
261+
- name: Commit documentation changes
262+
run: |
263+
git clone https://github.com/${GITHUB_REPOSITORY}.git \
264+
--branch gh-pages --single-branch gh-pages
265+
rm -R gh-pages/*
266+
cp -r docs/_build/html/* gh-pages/
267+
cp .gitignore gh-pages/
268+
touch gh-pages/.nojekyll
269+
cd gh-pages
270+
git config --local user.email "[email protected]"
271+
git config --local user.name "GitHub Action"
272+
git add . --all
273+
git commit -m "Update documentation" -a || true
274+
# The above command will fail if no changes were present, so we ignore
275+
# the return code.
276+
- name: Push changes
277+
uses: ad-m/github-push-action@master
278+
with:
279+
branch: gh-pages
280+
directory: gh-pages
281+
github_token: ${{secrets.GITHUB_TOKEN}}
282+
- name: Compress docs static site artifacts
283+
run: zip -r docs-static-pharus-${PHARUS_VERSION}.zip docs/_build/html
284+
- name: Upload docs static site to release
285+
uses: actions/upload-release-asset@v1
286+
env:
287+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
288+
with:
289+
upload_url: ${{needs.publish-release.outputs.release_upload_url}}
290+
asset_path: docs-static-pharus-${PHARUS_VERSION}.zip
291+
asset_name: docs-static-pharus-${PHARUS_VERSION}.zip
292+
asset_content_type: application/zip
293+
# fail_on_unmatched_files: true

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ docker-compose.y*ml
55
.coverage
66
*.egg-info
77
dist
8-
build
8+
build
9+
docs/_build
10+
*.tar.gz

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
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-
## [Unreleased]
5+
## [0.1.0b1] - 2021-03-11
66

77
### Fixed
88
- Fixed behavior where using list_table with a nonexistent schema_name creates it instead of returning an error message (#65) PR #63
99

10+
### Changed
11+
- Contribution policy to follow directly the general DataJoint Contribution Guideline. (#91) PR #94
12+
13+
### Added
14+
- Issue templates for bug reports and enhancement requests. PR #94
15+
- Docker environment for documentation build. (#92) PR #94
16+
- Add Sphinx-based documentation source and fix parsing issues. (#92) PR #94
17+
- GitHub Actions automation that publishes on release new docs to release and GitHub Pages. (#92) PR #94
18+
1019
## [0.1.0b0] - 2021-02-26
1120

1221
### Security
@@ -41,6 +50,6 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
4150
- Support for DataJoint attribute types: `varchar`, `int`, `float`, `datetime`, `date`, `time`, `decimal`, `uuid`.
4251
- Check dependency utility to determine child table references.
4352

44-
[Unreleased]: https://github.com/datajoint/pharus/compare/0.1.0b0...HEAD
53+
[0.1.0b1]: https://github.com/datajoint/pharus/compare/0.1.0b0...0.1.0b1
4554
[0.1.0b0]: https://github.com/datajoint/pharus/compare/0.1.0a5...0.1.0b0
4655
[0.1.0a5]: https://github.com/datajoint/pharus/releases/tag/0.1.0a5

CONTRIBUTING.md

Lines changed: 0 additions & 88 deletions
This file was deleted.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG PY_VER
22
ARG DISTRO
33
ARG IMAGE
44
FROM datajoint/${IMAGE}:py${PY_VER}-${DISTRO}
5-
COPY --chown=dja:anaconda ./README.md ./requirements.txt ./setup.py \
5+
COPY --chown=dja:anaconda ./README.rst ./requirements.txt ./setup.py \
66
/main/
77
COPY --chown=dja:anaconda ./pharus/*.py /main/pharus/
88
RUN \

0 commit comments

Comments
 (0)