Skip to content

Commit

Permalink
sssom using cookiecutter (#382)
Browse files Browse the repository at this point in the history
* Restructured proj files

* more updates

* updated sssom-schema

* All tests pass .... linkml free!!!

* formatted and corrected

* updated workflows

* commenting cache

* Add tox

* add tox within poetry

* formatted

* ~whitelist_externals~ => allowlist_externals

* added docstring

* docstr happy

* os.path instead of Path

* tweaks to workflow

* cleanup

* reverted to original

* added manifest

* added maifest check to qc

* removed manifest from tox and qc

* simplify

* fixed indent

* reverted back to using poetry

* edits to qc.yaml and poetry update

* added tox

* poetry==1.3.2

* updated lock file

* test with path

* reverted

* redundant line

* ' => "

* redundant

* redundant

* formatted

* deleted unnecessary files and updated poetry

* "cjm" for author_id => "orcid:1234"

* "cjm" for author_id => "orcid:1234"

* added shell=True

* update poetry version to 1.4.2 in gh actions workflow

* cleanup to workflow

* simplify workflow

* reverted back

* testing something new with workflow

* added tox

* added space

* back to 1.3.2

* Added functions within init
  • Loading branch information
hrshdhgd authored Jun 20, 2023
1 parent 94cf132 commit 32a7268
Show file tree
Hide file tree
Showing 61 changed files with 3,163 additions and 3,617 deletions.
24 changes: 24 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"template": "https://github.com/monarch-initiative/monarch-project-template.git",
"commit": "7a5148b11fd6f4f70da7ef921789e0d5fe720e01",
"checkout": null,
"context": {
"cookiecutter": {
"project_name": "sssom-py",
"github_org_name": "mapping-commons",
"__project_slug": "sssom",
"project_description": "SSSOM (Simple Standard for Sharing Ontology Mappings) is a TSV and RDF/OWL standard for ontology mappings.",
"min_python_version": "3.7",
"file_name": "main",
"greeting_recipient": "World",
"full_name": "Harshad Hegde",
"email": "[email protected]",
"__author": "Harshad Hegde <[email protected]>",
"license": "MIT",
"github_token_for_doc_deployment": "GH_TOKEN",
"github_token_for_pypi_deployment": "SSSOM_TOKEN",
"_template": "https://github.com/monarch-initiative/monarch-project-template.git"
}
},
"directory": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v3.0.2
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

Expand All @@ -16,22 +16,28 @@ jobs:
with:
python-version: 3.9

- name: Install Poetry.
uses: snok/[email protected]

- name: Install dependencies.
run: |
pip install -e .[docs]
poetry install -E docs
- name: Build documentation.
run: |
echo ${{ secrets.GH_TOKEN }} >> src/sssom/token.txt
mkdir gh-pages
touch gh-pages/.nojekyll
cd docs/
make clean html
poetry run sphinx-apidoc -o . ../src/sssom/ --ext-autodoc -f
poetry run sphinx-build -b html . _build
cp -r _build/html/* ../gh-pages/
- name: Deploy documentation.
if: ${{ github.event_name == 'push' }}
uses: JamesIves/github-pages-deploy-action@v4.3.0
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages
force: true
folder: gh-pages
folder: gh-pages
token: ${{ secrets.GH_TOKEN }}
35 changes: 20 additions & 15 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,26 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.0.2

- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.9
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.9

- name: Install pip
run: |
pip install --upgrade pip
pip install twine
python setup.py sdist
- name: Install Poetry
run: pip install poetry poetry-dynamic-versioning

- name: Install dependencies
run: poetry install --no-interaction

- name: Build source and wheel archives
run: poetry build

- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.SSSOM_TOKEN }}

- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.SSSOM_TOKEN }}

50 changes: 28 additions & 22 deletions .github/workflows/qc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: SSSOM qc
name: sssom-py QC

on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
Expand All @@ -12,25 +11,32 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: [ ubuntu-latest, windows-latest ]
os: [ubuntu-latest, windows-latest]
python-version: [ "3.8", "3.9", "3.10" ]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install --upgrade pip
pip install tox
- name: Check manifest
run: tox -e manifest
- name: Lint with flake8
run: tox -e flake8
- name: Test with MyPy
run: tox -e mypy
- name: Test with pytest
run: tox -e py
- uses: actions/[email protected]

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: |
pip install --upgrade pip
pip install poetry==1.3.2
- name: Install dependencies
run: |
poetry install --extras tests
poetry add tox
- name: Check code quality with flake8
run: poetry run tox -e flake8

- name: Check static typing with MyPy
run: poetry run tox -e mypy

- name: Test with pytest and generate coverage file
run: poetry run tox -e py
133 changes: 132 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,137 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# User added
*/__pycache__/*
.venv
venv
sssom/__pycache__/
.idea
sssom.egg-info
build/
Expand Down
32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Contribution Guidelines

When contributing to this repository, please first discuss the changes you wish to make via an issue, email, or any other method, with the owners of this repository before issuing a pull request.

## How to contribute

### Reporting bugs or making feature requests

To report a bug or suggest a new feature, please go to the [mapping-commons/sssom-py issue tracker](https://github.com/mapping-commons/sssom-py/issues), as we are
consolidating issues there.

Please supply enough details to the developers to enable them to verify and troubleshoot your issue:

* Provide a clear and descriptive title as well as a concise summary of the issue to identify the problem.
* Describe the exact steps which reproduce the problem in as many details as possible.
* Describe the behavior you observed after following the steps and point out what exactly is the problem with that behavior.
* Explain which behavior you expected to see instead and why.
* Provide screenshots of the expected or actual behaviour where applicable.


### The development lifecycle

1. Create a bug fix or feature development branch, based off the `main` branch of the upstream repo, and not your fork. Name the branch appropriately, briefly summarizing the bug fix or feature request. If none come to mind, you can include the issue number in the branch name. Some examples of branch names are, `bugfix/breaking-pipfile-error` or `feature/add-click-cli-layer`, or `bugfix/issue-414`
2. Make sure your development branch has all the latest commits from the `main` branch.
3. After completing work and testing locally, push the code to the appropriate branch on your fork.
4. Create a pull request from the bug/feature branch of your fork to the `main` branch of the upstream repository.

Note: All the development must be done on a branch on your fork.

ALSO NOTE: github.com lets you create a pull request from the main branch, automating the steps above.

> A code review (which happens with both the contributor and the reviewer present) is required for contributing.
Loading

0 comments on commit 32a7268

Please sign in to comment.