Skip to content

Commit

Permalink
668 setup repo structure (#2)
Browse files Browse the repository at this point in the history
* Setup structure using govcookiecutter

* remove duplicate package in dev requirements

* Update setup.cfg author

* Update repo structure:

- Change PR Template
- Create workflows
- Point requirements to MBS repo
- create placeholder unit test for workflows

* Update setup.cfg

* Update setup.cfg

* Update setup.cfg

updating to be same structure as mbs
  • Loading branch information
Jday7879 authored Nov 28, 2024
1 parent 540a794 commit 9fa813d
Show file tree
Hide file tree
Showing 53 changed files with 2,672 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Environment variables go here, and can be read in by Python using the `python-dotenv`
# package, and `os.getenv`:
#
# ------------------------------------------------------------------------------------
# from dotenv import load_dotenv
# import os
#
# # Load the environment variables from the `.env` file, overriding any system
# # environment variables
# load_dotenv(override=True)
#
# # Load secrets from the `.secrets` file, overriding any system environment variables
# load_dotenv(".secrets", override=True)
#
# # Example variable
# EXAMPLE_VARIABLE = os.getenv("EXAMPLE_VARIABLE")
# ------------------------------------------------------------------------------------
#
# For folder/file path environment variables, use relative paths.
#
# DO NOT STORE SECRETS HERE - this file is version-controlled! You should store secrets
# in the untracked `.secrets` file.

# Add environment variables for the `docs` directory
DIR_DOCS=./docs

# Add environment variable for package directory
DIR_SRC = ./cons_results

# Add environment variables for the `src` directories
DIR_SRC_COOKIECUTTER.REPO_NAME.LOWER().REPLACE('','_').REPLACE('-','_') =./cons_results

# Add environment variables for the `tests` directory
DIR_TESTS=./tests
23 changes: 23 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Orchestration file to load environment variables from the `.env` and `.secrets` files.
#
# Only used by systems with `direnv` (https://direnv.net/) installed. Environment
# variables can be read in by Python using `os.getenv` _without_ using `python-dotenv`:
#
# ------------------------------------------------------------------------------------
# import os
#
# # Example variable
# EXAMPLE_VARIABLE = os.getenv("EXAMPLE_VARIABLE")
# ------------------------------------------------------------------------------------
#
# DO NOT STORE SECRETS HERE - this file is version-controlled! You should store secrets
# in the untracked `.secrets` file. This is loaded here using the `dotenv_if_exists`
# command.

# Add the working directory to `PYTHONPATH`; allows Jupyter notebooks in the
# `notebooks` folder to import `src`
export PYTHONPATH="$PYTHONPATH:$(pwd)"

# Load the `.env` file, and `.secrets` (if it exists)
dotenv .env
dotenv_if_exists .secrets
9 changes: 9 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[flake8]
# Rule definitions: http://flake8.pycqa.org/en/latest/user/error-codes.html
# D203: 1 blank line required before class docstring
# W503: line break before binary operator
exclude = venv*,__pycache__,node_modules,bower_components,migrations
ignore = D203,W503
max-complexity = 9
max-line-length = 88
extend-ignore = E203
62 changes: 62 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Pull Request Title

<!--
Please provide a descriptive title for the pull request.
-->

# Summary

Add your summary here - keep it brief, to the point, and in plain English.

# Type of Change

<!--
Please select the type of change that applies to this pull request.
-->

- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
- [ ] Other (please describe):


# Checklists

<!--
These are do-confirm checklists; it confirms that you have done each item.
If actions are irrelevant, please add a comment stating why.
Incomplete pull/merge requests may be blocked until actions are resolved, or closed at
the reviewers' discretion.
-->

This pull request meets the following requirements:

## Creator Checklist

- [ ] Installable with all dependencies recorded
- [ ] Runs without error
- [ ] Follows PEP8 and project-specific conventions
- [ ] Appropriate use of comments, for example, no descriptive comments
- [ ] Functions documented using Numpy style docstrings
- [ ] Assumptions and decisions log considered and updated if appropriate
- [ ] Unit tests have been updated to cover essential functionality for a reasonable range of inputs and conditions
- [ ] Other forms of testing such as end-to-end and user-interface testing have been considered and updated as required

If you feel some of these conditions do not apply for this pull request, please
add a comment to explain why.

## Reviewer Checklist

- [ ] Test suite passes (locally as a minimum)
- [ ] Peer reviewed with review recorded

# Additional Information

Please provide any additional information or context that would help the reviewer understand the changes in this pull request.

# Related Issues

Link any related issues or pull requests here.
48 changes: 48 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: cml_runtimes

on:
# Triggers the workflow on pull requests to main branch
pull_request:
branches: [ main ]

jobs:
commit-hooks:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: 3.10.13

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Check commit hooks
run: |
pre-commit run --all-files
testing-cml:
runs-on: ubuntu-latest
strategy:
matrix:
cml_version: ["3.8", "3.9", "3.10","3.11"]
steps:
- name: checkout ml-runtimes #https://github.com/cloudera/ml-runtimes
uses: actions/checkout@master
with:
repository: cloudera/ml-runtimes
- name: build runtime cml_${{matrix.cml_version}}
run: docker build -t cml:${{matrix.cml_version}} -f 'pbj-workbench-python${{matrix.cml_version}}-standard.Dockerfile' .
- name: checkout to repository
uses: actions/checkout@v3
- name: create container
run: docker run -id --name container_${{matrix.cml_version}} -v"$(pwd)"://home/cdsw cml:${{matrix.cml_version}}
- name: build in dev mode
run: docker exec container_${{matrix.cml_version}} pip install ."[dev]"
- name: check env
run: docker exec container_${{matrix.cml_version}} pip list
- name: test
run: docker exec container_${{matrix.cml_version}} pytest
Loading

0 comments on commit 9fa813d

Please sign in to comment.