Skip to main content

An MCP service for building queries against SDSS catalogs.

Project description

SSEC-JHU <package_name>

CI Documentation Status codecov Security DOI

SSEC-JHU Logo

Based on https://github.com/nicknochnack/BuildMCPServer

Base repo template to be used by all others.

Things to do when using this template:

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 <environment_name> 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:

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cas_sdss_mcp-0.1.1.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cas_sdss_mcp-0.1.1-py3-none-any.whl (477.6 kB view details)

Uploaded Python 3

File details

Details for the file cas_sdss_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: cas_sdss_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cas_sdss_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 487db5817a1304dd29e6e8ef2da596d9e2003c8993f1bf968649aab4f479adea
MD5 6fea865eaca281c0f2853297a5d88517
BLAKE2b-256 0fdd268edc59868d39cfc6cd155c5b25557532509748791b7294ef3b8ca15fd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cas_sdss_mcp-0.1.1.tar.gz:

Publisher: dist.yml on sciserver/cas-jobs-sdss-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cas_sdss_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cas_sdss_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 477.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cas_sdss_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0345ea9c876a38f2d7dc449ae069674f32688542cba6c10a83c31f17dc597a98
MD5 ff72156fd2219435702ebaa3bc3c0738
BLAKE2b-256 bc5d97e001977ff93851cb410f5ce06969cadab222bd4f7fd6abc263b3dce40b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cas_sdss_mcp-0.1.1-py3-none-any.whl:

Publisher: dist.yml on sciserver/cas-jobs-sdss-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page