This repository has been archived by the owner on Jul 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed DBInfo interface and updated README (#13)
* Changed DBInfo interface and updated README * Version bumped to 0.14.0 * Update cruft * comment out flake8 issues * Fix DBInfo references for test * PR comments * typos Co-authored-by: ns-circle-ci <[email protected]>
- Loading branch information
1 parent
9f2cb8a
commit bcf0ca1
Showing
23 changed files
with
239 additions
and
48 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,11 @@ | ||
description: Restores the build-test cache for pyenv, poetry, and pre-commit | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- v2-pyenv-{{ arch }}-pynocular-{{ checksum "poetry.lock" }} | ||
- restore_cache: | ||
keys: | ||
- v2-poetry-{{ arch }}-pynocular-{{ checksum "poetry.lock" }} | ||
- restore_cache: | ||
keys: | ||
- v2-precommit-{{ arch }}-pynocular-{{ checksum ".pre-commit-config.yaml" }} |
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,14 @@ | ||
description: Stores the build-test cache for pyenv, poetry, and pre-commit | ||
steps: | ||
- save_cache: | ||
key: v2-pyenv-{{ arch }}-pynocular-{{ checksum "poetry.lock" }} | ||
paths: | ||
- "~/.pyenv" | ||
- save_cache: | ||
key: v2-poetry-{{ arch }}-pynocular-{{ checksum "poetry.lock" }} | ||
paths: | ||
- "~/.cache/pypoetry" | ||
- save_cache: | ||
key: v2-precommit-{{ arch }}-pynocular-{{ checksum ".pre-commit-config.yaml" }} | ||
paths: | ||
- "~/.cache/pre-commit" |
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,22 @@ | ||
description: Store test artifacts in CCI workflow run | ||
parameters: | ||
artifacts_path: | ||
description: The absolute path to the artifacts stored as an env var | ||
type: string | ||
artifacts_storage_dir: | ||
description: The directory in /tmp where we want to store the artifacts | ||
type: string | ||
default: << parameters.artifacts_path >> | ||
export_test_results: | ||
description: Whether or not to upload the artifacts as Test Summary metadata | ||
type: boolean | ||
default: false | ||
steps: | ||
- store_artifacts: | ||
path: << parameters.artifacts_path >> | ||
destination: << parameters.artifacts_storage_dir >> | ||
- when: | ||
condition: << parameters.export_test_results >> | ||
steps: | ||
- store_test_results: | ||
path: << parameters.artifacts_path >> |
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 |
---|---|---|
|
@@ -213,10 +213,60 @@ commands: | |
pip install poetry | ||
poetry config pypi-token.pypi "$POETRY_PYPI_TOKEN_PYPI" | ||
name: Configure Poetry | ||
restore-test-cache: | ||
description: Restores the build-test cache for pyenv, poetry, and pre-commit | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- v2-pyenv-{{ arch }}-pynocular-{{ checksum "poetry.lock" }} | ||
- restore_cache: | ||
keys: | ||
- v2-poetry-{{ arch }}-pynocular-{{ checksum "poetry.lock" }} | ||
- restore_cache: | ||
keys: | ||
- v2-precommit-{{ arch }}-pynocular-{{ checksum ".pre-commit-config.yaml" }} | ||
save-test-cache: | ||
description: Stores the build-test cache for pyenv, poetry, and pre-commit | ||
steps: | ||
- save_cache: | ||
key: v2-pyenv-{{ arch }}-pynocular-{{ checksum "poetry.lock" }} | ||
paths: | ||
- ~/.pyenv | ||
- save_cache: | ||
key: v2-poetry-{{ arch }}-pynocular-{{ checksum "poetry.lock" }} | ||
paths: | ||
- ~/.cache/pypoetry | ||
- save_cache: | ||
key: v2-precommit-{{ arch }}-pynocular-{{ checksum ".pre-commit-config.yaml" }} | ||
paths: | ||
- ~/.cache/pre-commit | ||
store-test-artifacts: | ||
description: Store test artifacts in CCI workflow run | ||
parameters: | ||
artifacts_path: | ||
description: The absolute path to the artifacts stored as an env var | ||
type: string | ||
artifacts_storage_dir: | ||
default: << parameters.artifacts_path >> | ||
description: The directory in /tmp where we want to store the artifacts | ||
type: string | ||
export_test_results: | ||
default: false | ||
description: Whether or not to upload the artifacts as Test Summary metadata | ||
type: boolean | ||
steps: | ||
- store_artifacts: | ||
destination: << parameters.artifacts_storage_dir >> | ||
path: << parameters.artifacts_path >> | ||
- when: | ||
condition: << parameters.export_test_results >> | ||
steps: | ||
- store_test_results: | ||
path: << parameters.artifacts_path >> | ||
executors: | ||
default: | ||
docker: | ||
- image: cimg/python:3.6 | ||
- image: cimg/python:3.9 | ||
resource_class: small | ||
python-3_6-medium: | ||
docker: | ||
|
@@ -291,6 +341,7 @@ jobs: | |
- ghpr/build-prospective-branch | ||
- aws-cli/install | ||
- circleci-cli/install | ||
- restore-test-cache | ||
- poetry-configure | ||
- bump-branch-version | ||
- run: | ||
|
@@ -310,11 +361,19 @@ jobs: | |
--origin "origin/${CIRCLE_BRANCH}" \ | ||
--show-diff-on-failure | ||
name: Run commit hooks | ||
- run: poetry run pytest --junit-xml .junit/unit/results.xml | ||
- store_test_results: | ||
path: .junit | ||
- ghpr/post-pr-comment: | ||
comment: Tests failed! | ||
- run: | ||
command: | | ||
mkdir -p test-results/unit | ||
poetry run pytest --junit-xml test-results/unit/results.xml | ||
name: Run tests | ||
- store-test-artifacts: | ||
artifacts_path: test-results | ||
export_test_results: true | ||
- save-test-cache | ||
- ghpr/slack-pr-author: | ||
color: '#fcaaa3' | ||
get_slack_user_by: meseeks | ||
message: ':ci-fail: Tests failed' | ||
when: on_fail | ||
poetry-publish: | ||
description: Publish a release of the project | ||
|
@@ -328,6 +387,14 @@ jobs: | |
- run: poetry install | ||
- run: poetry build | ||
- run: poetry publish | ||
send-slack-on-pr-success: | ||
description: Send a Slack message to the PR author on PR workflow success. | ||
executor: default | ||
steps: | ||
- ghpr/slack-pr-author: | ||
color: '#4cb79c' | ||
get_slack_user_by: meseeks | ||
message: ':ci-success: PR tests have passed!' | ||
orbs: | ||
aws-cli: circleci/[email protected] | ||
circleci-cli: circleci/[email protected] | ||
|
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,3 +1,3 @@ | ||
docker: | ||
- image: cimg/python:3.6 | ||
- image: cimg/python:3.9 | ||
resource_class: small |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
description: Send a Slack message to the PR author on PR workflow success. | ||
executor: default | ||
steps: | ||
- ghpr/slack-pr-author: | ||
message: ':ci-success: PR tests have passed!' | ||
get_slack_user_by: meseeks | ||
color: "#4cb79c" |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# Run the cruft check and if it fails prompt user to run the manual update | ||
cruft check | ||
if [[ $? -ne 0 ]]; then | ||
echo "This project's cruft is not up to date." | ||
echo "Please run 'cruft update' and follow the prompts to update this repository." | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# See: https://help.github.com/en/articles/about-code-owners | ||
* @ssantana-ns @jdrake |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Overview of changes | ||
*Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.* | ||
|
||
*Please indicate the type of change: bug(fix), new feature, tests, config/infrastructure, docs, etc.* | ||
*Be sure to link to that issue and place it in the name of the PR.* | ||
|
||
## For software test | ||
*Describe any pertinent instructions to get this running or vulnerable test areas.* | ||
|
||
## Additional details | ||
* additional notes, things that were changed, areas of concern, etc.* | ||
|
||
## Important Reminders | ||
- We like PRs to be less than 300 LOC | ||
- Run the pre-commit for both hook stages! (pre-commit and pre-push) | ||
- Add tests! Do not forget that we use pytest here at Narrative Science. 80% Code Coverage recommended. | ||
- Use proper mocks in tests. Do not write tests without mocks that test external libraries or external endpoints. | ||
- Add necessary documentation to README's | ||
- Notion page with our detailed [PR guidelines](https://www.notion.so/narsci/Code-Reviews-fc8109101b2144739a7d9cde1fe2248b) |
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,5 +1,5 @@ | ||
"""Lightweight ORM that lets you query your database using Pydantic models and asyncio""" | ||
|
||
__version__ = "0.13.0" | ||
__version__ = "0.14.0" | ||
|
||
from pynocular.engines import DatabaseType, DBInfo |
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
Oops, something went wrong.