base-template

Base repo template

https://github.com/ssec-jhu/base-template

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
    Organization ssec-jhu has institutional domain (ai.jhu.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.9%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Base repo template

Basic Info
  • Host: GitHub
  • Owner: ssec-jhu
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Size: 594 KB
Statistics
  • Stars: 3
  • Watchers: 7
  • Forks: 2
  • Open Issues: 13
  • Releases: 4
Created about 3 years ago · Last pushed 9 months ago
Metadata Files
Readme Contributing License Code of conduct Codeowners Zenodo

README.md

SSEC-JHU

CI Documentation Status codecov Security DOI

SSEC-JHU Logo

Base repo template to be used by all others.

Things to do when using this template:

  • Run python project_setup.py
  • Uncomment above DOI in README.md and correct <insert_ID_number>.
  • Correct "description" field in .zenodo.json to reflect description of child repo.
  • Correct the CI Status badge with the correct token in the URL.
  • Import package into https://readthedocs.org/.
  • Update zenodo.json. For more details see zenodo.json docs and zenodo docs on contributors vs creators.
  • Update quickstart guide below.

What's included in this template:

  • Licence file
  • Code of Conduct
  • Build & Setup, inc. pip dependency requirements.
  • Dependabot GitHub action
  • CI for GitHub actions: lint, pytest, build & publish docker image to GitHub Packages.
  • Dockerfile.
  • Pytest example(s).
  • Githooks.

Quickstart Guide

Add here, streamlined instructions on how to get the code running as swiftly as possible, and provide usage example(s). This shouldn't attempt to cover all OS's and/or build variations - just the canonical. Since users are most likely viewing this README from GitHub.com, assuming a repo context might be best, where instructions look like those below. Alternatively, if this package is distributed on PyPi, perhaps just pip install <package-name>, followed by quick user instructions, will suffice.

  • git clone https://github.com/ssec-jhu/base-template
  • conda create -n package_name python pip
  • conda activate package_name
  • pip pinstall -e .
  • Add user instructions.

Installation, Build, & Run instructions

Conda:

For additional cmds see the Conda cheat-sheet.

  • Download and install either miniconda or anaconda.
  • Create new environment (env) and install conda create -n <environment_name>
  • Activate/switch to new env conda activate <environment_name>
  • cd into repo dir.
  • Install python and pip conda install python=3.11 pip
  • Install all required dependencies (assuming local dev work), there are two ways to do this
    • If working with tox (recommended) pip install -r requirements/dev.txt.
    • If you would like to setup an environment with all requirements to run outside of tox pip install -r requirements/all.txt.

Build:

#### with Docker: * Download & install Docker - see Docker install docs. * cd into repo dir. * Build image: docker build -t <image_name> .

#### with Python ecosystem: * cd into repo dir. * conda activate <environment_name> * Build and install package in conda env: pip install . * Do the same but in dev/editable mode (changes to repo will be reflected in env installation upon python kernel restart) NOTE: This is the preferred installation method for dev work. pip install -e .. NOTE: If you didn't install dependencies from requirements/dev.txt, you can install a looser constrained set of deps using: pip install -e .[dev].

Run

#### with Docker: * Follow the above Build with Docker instructions. * Run container from image: docker run -d -p 8000:8000 <image_name>. NOTE: -p 8000:8000 is specific to the example application using port 8000. * Alternatively, images can be pulled from ghcr.io/ssec-jhu/ e.g., docker pull ghcr.io/ssec-jhu/base-template:pr-1.

#### with Python ecosystem: * Follow the above Build with Python ecosystem instructions. * Run uvicorn package_name.app.main:app --host 0.0.0.0 --port", "8000. NOTE: This is just an example and is obviously application dependent.

Usage:

To be completed by child repo.

Testing

NOTE: The following steps require pip install -r requirements/dev.txt.

Using tox

  • Run tox tox. This will run all of linting, security, test, docs and package building within tox virtual environments.
  • To run an individual step, use tox -e {step} for example, tox -e test, tox -e build-docs, etc.

Typically, the CI tests run in github actions will use tox to run as above. See also ci.yml.

Outside of tox:

The below assume you are running steps without tox, and that all requirements are installed into a conda environment, e.g. with pip install -r requirements/all.txt.

NOTE: Tox will run these for you, this is specifically if there is a requirement to setup environment and run these outside the purview of tox.

Linting:

Facilitates in testing typos, syntax, style, and other simple code analysis tests. * cd into repo dir. * Switch/activate correct environment: conda activate <environment_name> * Run ruff . * This can be automatically run (recommended for devs) every time you git push by installing the provided pre-push git hook available in ./githooks. Instructions are in that file - just cp ./githooks/pre-push .git/hooks/;chmod +x .git/hooks/pre-push.

Security Checks:

Facilitates in checking for security concerns using Bandit. * cd into repo dir. * bandit --severity-level=medium -r package_name

Unit Tests:

Facilitates in testing core package functionality at a modular level. * cd into repo dir. * Run all available tests: pytest . * Run specific test: pytest tests/test_util.py::test_base_dummy.

Regression tests:

Facilitates in testing whether core data results differ during development. * WIP

Smoke Tests:

Facilitates in testing at the application and infrastructure level. * WIP

Build Docs:

Facilitates in building, testing & viewing the docs. * cd into repo dir. * pip install -r requirements/docs.txt * cd docs * make clean * make html * To view the docs in your default browser run open docs/_build/html/index.html.

Owner

  • Name: Scientific Software Engineering Center at JHU
  • Login: ssec-jhu
  • Kind: organization
  • Email: ssec@jhu.edu
  • Location: United States of America

Accelerating Software Development for Science Research

GitHub Events

Total
  • Create event: 28
  • Release event: 4
  • Issues event: 13
  • Delete event: 20
  • Issue comment event: 46
  • Push event: 65
  • Pull request review comment event: 29
  • Pull request review event: 50
  • Pull request event: 45
  • Fork event: 1
Last Year
  • Create event: 28
  • Release event: 4
  • Issues event: 13
  • Delete event: 20
  • Issue comment event: 46
  • Push event: 65
  • Pull request review comment event: 29
  • Pull request review event: 50
  • Pull request event: 45
  • Fork event: 1

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 7
  • Total pull requests: 75
  • Average time to close issues: 2 months
  • Average time to close pull requests: 6 days
  • Total issue authors: 2
  • Total pull request authors: 6
  • Average comments per issue: 0.43
  • Average comments per pull request: 1.53
  • Merged pull requests: 58
  • Bot issues: 0
  • Bot pull requests: 52
Past Year
  • Issues: 7
  • Pull requests: 30
  • Average time to close issues: 2 months
  • Average time to close pull requests: 8 days
  • Issue authors: 2
  • Pull request authors: 5
  • Average comments per issue: 0.43
  • Average comments per pull request: 1.03
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 21
Top Authors
Issue Authors
  • jamienoss (7)
  • ryanhausen (1)
  • dependabot[bot] (1)
Pull Request Authors
  • dependabot[bot] (52)
  • jamienoss (12)
  • ryanhausen (5)
  • amitschang (4)
  • xiangchenjhu (1)
  • imaitland (1)
Top Labels
Issue Labels
documentation (3) CI (1) dependencies (1) python (1)
Pull Request Labels
dependencies (54) python (19) documentation (3) github_actions (1) CI (1)

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • codecov/codecov-action v3 composite
  • docker/build-push-action f2a1d5e99d037542a71f64918e516c093c6f3fc4 composite
  • docker/login-action 65b78e6e13532edd9afa3aa52ac7964289d1a9c1 composite
  • docker/metadata-action 9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 composite
.github/workflows/security.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
Dockerfile docker
  • python 3.11-slim build
pyproject.toml pypi
  • fastapi [all]
requirements/dev.txt pypi
  • bandit ==1.7.5 development
  • build ==0.10.0 development
  • httpx ==0.24.1 development
  • pytest ==7.4.0 development
  • pytest-cov ==4.1.0 development
  • ruff ==0.0.288 development
  • tox ==4.11.3 development
requirements/docs.txt pypi
  • nbsphinx ==0.9.2
  • sphinx ==6.2.1
  • sphinx-automodapi ==0.15.0
  • sphinx-issues ==3.0.1
  • sphinx_rtd_theme ==1.3.0
requirements/prd.txt pypi
  • fastapi ==0.103.0
  • uvicorn ==0.23.2
.github/workflows/dist.yml actions
  • actions/checkout v4 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite