-
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.
JIRA-1630 Minor: Initial Stub Development for Provena Client Tool. (#1)
* Created initial package setup with cookie-cutter template * Updated CI/CD script to only run on main branch, fixed incorrect imports and deleted files that were not needed * Integrated mypi in the package and was able to successfully build. * Shifted from a class to a data-class for Settings, updated CI-CD script and README.md and removed CONDUCT.md files. * Updated CI-CD script to use OCID instead of API tokens, and made it trigger on initial branch for testing purposes. * Simplifying CI-CD file to ensure it runs without issues. * Removed pull-request for now from CI/CD script. * Updated dependencies for CI * Updated poetry lock file for CI. * Added dummy test for CI to pass. * Updated CI to support pull request, as I am gonna merge pull request to main to release package. --------- Co-authored-by: Parth-Kulkarni
- Loading branch information
1 parent
3bd04b3
commit cfab8c2
Showing
22 changed files
with
2,915 additions
and
33 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,83 @@ | ||
name: ci-cd | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Check-out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install poetry | ||
uses: snok/install-poetry@v1 | ||
|
||
- name: Install package | ||
run: poetry install | ||
|
||
- name: Mypy type check | ||
run: poetry run mypy . | ||
|
||
- name: Test with pytest | ||
run: poetry run pytest tests/ --cov=provenaclient --cov-report=xml | ||
|
||
- name: Use Codecov to track coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.xml | ||
|
||
- name: Build documentation | ||
run: poetry run make html --directory docs/ | ||
|
||
cd: | ||
permissions: | ||
id-token: write | ||
contents: write | ||
needs: ci | ||
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/inital-branch') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Check-out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Use Python Semantic Release to prepare release | ||
id: release | ||
uses: python-semantic-release/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
- name: Test install from TestPyPI | ||
if: steps.release.outputs.released == 'true' | ||
run: | | ||
pip install \ | ||
--index-url https://test.pypi.org/simple/ \ | ||
--extra-index-url https://pypi.org/simple \ | ||
provenaclient | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: steps.release.outputs.released == 'true' | ||
|
||
- name: Publish package distributions to GitHub Releases | ||
uses: python-semantic-release/upload-to-gh-release@main | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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,27 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.9" | ||
jobs: | ||
post_create_environment: | ||
# Install poetry | ||
# https://python-poetry.org/docs/#installing-manually | ||
- pip install poetry | ||
# Tell poetry to not use a virtual environment | ||
- poetry config virtualenvs.create false | ||
post_install: | ||
# Install dependencies with 'docs' dependency group | ||
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups | ||
- poetry install | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py |
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 @@ | ||
# Changelog | ||
|
||
<!--next-version-placeholder--> | ||
|
||
## v0.1.0 (04/04/2024) | ||
|
||
- First release of `provenaclient`! |
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,73 @@ | ||
# Contributing | ||
|
||
Contributions are welcome, and they are greatly appreciated! Every little bit | ||
helps, and credit will always be given. | ||
|
||
## Types of Contributions | ||
|
||
### Report Bugs | ||
|
||
If you are reporting a bug, please include: | ||
|
||
* Your operating system name and version. | ||
* Any details about your local setup that might be helpful in troubleshooting. | ||
* Detailed steps to reproduce the bug. | ||
|
||
### Fix Bugs | ||
|
||
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help | ||
wanted" is open to whoever wants to implement it. | ||
|
||
### Implement Features | ||
|
||
Look through the GitHub issues for features. Anything tagged with "enhancement" | ||
and "help wanted" is open to whoever wants to implement it. | ||
|
||
### Write Documentation | ||
|
||
You can never have enough documentation! Please feel free to contribute to any | ||
part of the documentation, such as the official docs, docstrings, or even | ||
on the web in blog posts, articles, and such. | ||
|
||
### Submit Feedback | ||
|
||
If you are proposing a feature: | ||
|
||
* Explain in detail how it would work. | ||
* Keep the scope as narrow as possible, to make it easier to implement. | ||
* Remember that this is a volunteer-driven project, and that contributions | ||
are welcome :) | ||
|
||
## Get Started! | ||
|
||
Ready to contribute? Here's how to set up `provenaclient` for local development. | ||
|
||
1. Download a copy of `provenaclient` locally. | ||
2. Install `provenaclient` using `poetry`: | ||
|
||
```console | ||
$ poetry install | ||
``` | ||
|
||
3. Use `git` (or similar) to create a branch for local development and make your changes: | ||
|
||
```console | ||
$ git checkout -b name-of-your-bugfix-or-feature | ||
``` | ||
|
||
4. When you're done making changes, check that your changes conform to any code formatting requirements and pass any tests. | ||
|
||
5. Commit your changes and open a pull request. | ||
|
||
## Pull Request Guidelines | ||
|
||
Before you submit a pull request, check that it meets these guidelines: | ||
|
||
1. The pull request should include additional tests if appropriate. | ||
2. If the pull request adds functionality, the docs should be updated. | ||
3. The pull request should work for all currently supported operating systems and versions of Python. | ||
|
||
## Code of Conduct | ||
|
||
Please note that the `provenaclient` project is released with a | ||
Code of Conduct. By contributing to this project you agree to abide by its terms. |
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,2 +1,39 @@ | ||
# provena-python-client | ||
Client library for interfacing with a Provena instance | ||
# provenaclient | ||
|
||
A client library for interfacing with a Provena instance. | ||
|
||
## Installation | ||
|
||
```bash | ||
$ pip install provenaclient | ||
``` | ||
|
||
## Usage | ||
|
||
### How to get started with Poetry | ||
|
||
1) Run the Command: `curl -sSL https://install.python-poetry.org | python3 -`. | ||
2) Check if poetry was successfully installed by running `poetry --version`. | ||
3) You should now have be able to see your poetry version successfully. | ||
4) Now run the command `poetry shell`. This will activate the poetry virtual environment for you. | ||
5) Now finally run the command `poetry install`. This will install all dependencies defined within pyproject.toml. | ||
|
||
### My Poetry Installation is not being detected? | ||
1) This means that your PATH variable does not include the Poetry directory. | ||
2) Open your .bashrc file, using the command `nano ~/.bashrc`. | ||
3) Add the following line at the end of the file, `export PATH= "$HOME/.local/bin:$PATH"`. | ||
4) Reload your .bashrc file, using the command `source ~/.bashrc`. | ||
5) Verify that your poetry is now running, using the command `poetry --version`. | ||
|
||
|
||
|
||
## Contributing | ||
TODO | ||
|
||
## License | ||
|
||
`provenaclient` was created by Provena Development Team (CSIRO). Provena Development Team (CSIRO) retains all rights to the source and it may not be reproduced, distributed, or used to create derivative works. | ||
|
||
## Credits | ||
|
||
`provenaclient` was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter). |
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 @@ | ||
cookiecutter | ||
mypy |
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 @@ | ||
# Minimal makefile for Sphinx documentation | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = python -msphinx | ||
SPHINXPROJ = provenaclient | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
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 @@ | ||
```{include} ../CHANGELOG.md | ||
``` |
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,36 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = u"provenaclient" | ||
copyright = u"2024, Parth Kulkarni" | ||
author = u"Parth Kulkarni" | ||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
"myst_nb", | ||
"autoapi.extension", | ||
"sphinx.ext.napoleon", | ||
"sphinx.ext.viewcode", | ||
] | ||
autoapi_dirs = ["../src"] | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = "sphinx_rtd_theme" |
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 @@ | ||
```{include} ../CONTRIBUTING.md | ||
``` |
Oops, something went wrong.