Skip to content

Commit

Permalink
v0.3.0 Merge pull request #10 from McIntosh-Lab/staging
Browse files Browse the repository at this point in the history
Merge v0.3.0 changes into main
  • Loading branch information
Noah Frazier-Logue authored Jul 27, 2022
2 parents 8d35607 + 3188ef8 commit 8a0008e
Show file tree
Hide file tree
Showing 62 changed files with 24,247 additions and 12,120 deletions.
4 changes: 4 additions & 0 deletions .bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
exclude_dirs:
- plspy/_version.py
- versioneer.py
- plspy/tests
94 changes: 89 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ orbs:
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
build-and-test:
build-and-test-3_10:
docker:
- image: cimg/python:3.10.2
resource_class: medium
steps:
- checkout
- python/install-packages:
Expand All @@ -25,26 +26,109 @@ jobs:
- run:
name: Run tests
command: pytest
build-docs:
build-and-test-3_9:
docker:
- image: cimg/python:3.9
resource_class: medium
steps:
- checkout
- python/install-packages:
pkg-manager: pip
pip-dependency-file: requirements.txt
- run:
name: Run tests
command: pytest
build-and-test-3_8:
docker:
- image: cimg/python:3.8
resource_class: medium
steps:
- checkout
- python/install-packages:
pkg-manager: pip
pip-dependency-file: requirements.txt
- run:
name: Run tests
command: pytest
build-and-test-3_7:
docker:
- image: cimg/python:3.7
resource_class: medium
steps:
- checkout
- python/install-packages:
pkg-manager: pip
pip-dependency-file: requirements.txt
- run:
name: Run tests
command: pytest
build-docs:
docker:
- image: cimg/python:3.10.2
resource_class: medium
steps:
- checkout
- python/install-packages:
pkg-manager: pip
pip-dependency-file: requirements_dev.txt
- run:
name: build documentation
name: build documentation
command: |
cd docs
sphinx-build -M html . _build
test_pypi_publish-3_10:
docker:
- image: circleci/python:3.10
steps:
- checkout # checkout source code to working directory
- run:
command: | # create whl, install twine and publish to Test PyPI
python setup.py sdist bdist_wheel
sudo pip install pipenv
pipenv install twine
pipenv run twine upload --repository testpypi dist/* -u __token__ -p $TEST_PYPI_TOKEN
pypi_publish-3_10:
docker:
- image: circleci/python:3.10
steps:
- checkout # checkout source code to working directory
- run:
command: | # create whl, install twine and publish to PyPI
python setup.py sdist bdist_wheel
sudo pip install pipenv
pipenv install twine
pipenv run twine upload dist/* -u __token__ -p $PYPI_TOKEN
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
run-tests-and-build-docs:
# Inside the workflow, you define the jobs you want to run.
jobs:
- build-and-test
- build-and-test-3_10
- build-and-test-3_9
- build-and-test-3_8
- build-and-test-3_7
- build-docs
- test_pypi_publish-3_10:
requires:
- build-and-test-3_10
- build-and-test-3_9
- build-and-test-3_8
- build-and-test-3_7
- build-docs
filters:
branches:
only:
- staging

- pypi_publish-3_10:
requires:
- build-and-test-3_10
- build-and-test-3_9
- build-and-test-3_8
- build-and-test-3_7
- build-docs
filters:
branches:
only:
- main
15 changes: 15 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"ignorePaths": [
"**/node_modules/**",
"**/vscode-extension/**",
"**/.git/**",
".vscode",
"megalinter",
"package-lock.json",
"report"
],
"language": "en",
"noConfigSearch": true,
"words": [],
"version": "0.2"
}
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = E203, E266, E501, W503, F403, F401
max-line-length = 79
max-complexity = 18
select = B,C,E,F,W,T4,B9
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- If you're filing anything other than an issue, feel free to disregard this template-->
<!-- Assign a label and a Project (please use plspy-board) on the right side of the page-->

### Reproducing code example:
### Reproducing code example

<!-- A short code example that reproduces the problem/missing feature. It should be
self-contained, i.e., possible to run as-is via 'python myproblem.py' -->
Expand All @@ -14,10 +14,10 @@ import plspy

<!-- Remove these sections for a feature request -->

### Error message:
### Error message

<!-- Full error message, if any (starting from line Traceback: ...) -->

### plspy/Python version information:
### plspy/Python version information

<!-- Output from 'import sys, plspy; print(plspy.__version__, sys.version)' -->
82 changes: 82 additions & 0 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.github.io
name: MegaLinter

on:
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to master
push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
pull_request:
branches: [master, main]

# env: # Comment env block if you do not want to apply fixes
# Apply linter fixes configuration
# APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
# APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
# APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
build:
name: MegaLinter
runs-on: ubuntu-latest
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0

# MegaLinter
- name: MegaLinter
id: ml
# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.github.io/flavors/
uses: megalinter/megalinter/flavors/python@v5
env:
# All available variables are described in documentation
# https://megalinter.github.io/configuration/
VALIDATE_ALL_CODEBASE: true # Set ${{ github.event_name == &#39;push&#39; &amp;&amp; github.ref == &#39;refs/heads/main&#39; }} to validate only diff with main branch
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY

# Upload MegaLinter artifacts
- name: Archive production artifacts
if: ${{ success() }} || ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: MegaLinter reports
path: |
report
mega-linter.log
# Create pull request if applicable (for now works only on PR from same repository, not from forks)
- name: Create Pull Request with applied fixes
id: cpr
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
commit-message: "[MegaLinter] Apply linters automatic fixes"
title: "[MegaLinter] Apply linters automatic fixes"
labels: bot
- name: Create PR output
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
# Push new commit if applicable (for now works only on PR from same repository, not from forks)
- name: Prepare commit
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
run: sudo chown -Rc $UID .git/
- name: Commit and push applied linter fixes
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
commit_message: "[MegaLinter] Apply linters fixes"
6 changes: 3 additions & 3 deletions .github/workflows/sphinx_docs_to_gh_pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
- name: Make conda environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9 # Python version to build the html sphinx documentation
environment-file: devtools/conda-envs/docs_env.yaml # Path to the documentation conda environment
python-version: 3.9 # Python version to build the html sphinx documentation
environment-file: devtools/conda-envs/docs_env.yaml # Path to the documentation conda environment
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
Expand All @@ -32,4 +32,4 @@ jobs:
with:
branch: main
dir_docs: docs
sphinxopts: ''
sphinxopts: ""
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
__pycache__/
plspy/__pycache__/
*.py[cod]
plspy/.*.py[cod]
plspy/.*.sw[op]
plspy/*/.*.py[cod]
plspy/.*.sw[a-z]
plspy/io/.*.sw[a-z]
plspy/core/.*.sw[a-z]
plspy/visualize/.*.sw[a-z]
plspy/tests/.*.sw[a-z]
plspy/.nfs*

report/*

example_*/
*-info/
target/
.tox/
.pre-commit*

.coverage

build/
dist/
Expand Down
15 changes: 15 additions & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"threshold": 0,
"reporters": ["html", "markdown"],
"ignore": [
"**/node_modules/**",
"**/.git/**",
"**/.rbenv/**",
"**/.venv/**",
"**/*cache*/**",
"**/.github/**",
"**/.idea/**",
"**/report/**",
"**/*.svg"
]
}
29 changes: 29 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Configuration file for MegaLinter
# See all available variables at https://megalinter.github.io/configuration/ and in linters documentation

APPLY_FIXES: all # all, none, or list of linter keys
# ENABLE: # If you use ENABLE variable, all other languages/formats/tooling-formats will be disabled by default
ENABLE_LINTERS: # If you use ENABLE_LINTERS variable, all other linters will be disabled by default
- PYTHON_PYLINT
- PYTHON_BLACK
- PYTHON_FLAKE8
- PYTHON_ISORT
- PYTHON_BANDIT
- PYTHON_MYPY
- JSON
- MARKDOWN
- SPELL_MISSPELL
# DISABLE:
# - COPYPASTE # Uncomment to disable checks of excessive copy-pastes
# - SPELL # Uncomment to disable checks of spelling mistakes
SHOW_ELAPSED_TIME: true
FILEIO_REPORTER: false
DEFAULT_WORKSPACE: "~/.mega-linter/lint"
DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass

ADDITIONAL_EXCLUDED_DIRECTORIES:
- build
- dist
- docs
- devtools
- report
Empty file modified .tox/.package.lock
100755 → 100644
Empty file.
Loading

0 comments on commit 8a0008e

Please sign in to comment.