Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Synapse formation #65

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
Expand Down Expand Up @@ -72,10 +72,10 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: '3.11'
- name: Create a source distribution
run: python setup.py sdist
- name: Publish package to PyPI
Expand All @@ -93,10 +93,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
Expand All @@ -105,12 +105,12 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.1.1
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@v3.2.0
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
68 changes: 68 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
exclude: "^docs/conf.py|^docs/build/"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
exclude: ^mkdocs\.yml$
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ["--fix=auto"] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows

# - repo: https://github.com/astral-sh/ruff-pre-commit
# rev: "v0.0.270"
# hooks:
# - id: ruff

# - repo: https://github.com/pycqa/isort
# rev: 5.13.2
# hooks:
# - id: isort
# name: isort (python)

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3

# - repo: https://github.com/PyCQA/bandit
# rev: 1.7.5
# hooks:
# - id: bandit
# args: ["-c", "pyproject.toml"]
# additional_dependencies: ["bandit[toml]"]
# - repo: https://github.com/asottile/blacken-docs
# rev: v1.12.0
# hooks:
# - id: blacken-docs
# additional_dependencies: [black]

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: 'v1.0.1'
# hooks:
# - id: mypy
# additional_dependencies: [pydantic~=1.10]

# Checks for missing docstrings
# - repo: https://github.com/econchick/interrogate
# rev: 1.5.0
# hooks:
# - id: interrogate
# exclude: ^(docs/conf.py|setup.py|tests)
# args: [--config=pyproject.toml]

# finds dead python code
# - repo: https://github.com/jendrikseipp/vulture
# rev: 'v2.7'
# hooks:
# - id: vulture
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim-buster
FROM python:3.11

WORKDIR /root/synapseformation
COPY . ./
Expand Down
847 changes: 475 additions & 372 deletions Pipfile.lock

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# synapseformation

[![Get synapseformation from PyPI](https://img.shields.io/pypi/v/synapseformation.svg?style=for-the-badge&logo=pypi)](https://pypi.python.org/pypi/synapseformation) [![GitHub CI](https://img.shields.io/github/workflow/status/Sage-Bionetworks/synapseformation/build.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/Sage-Bionetworks/synapseformation)
[![Coverage Status](https://img.shields.io/coveralls/github/Sage-Bionetworks/synapseformation.svg?&style=for-the-badge&label=coverage&logo=Coveralls)](https://coveralls.io/github/Sage-Bionetworks/synapseformation)
[![Get synapseformation from PyPI](https://img.shields.io/pypi/v/synapseformation.svg?&logo=pypi)](https://pypi.python.org/pypi/synapseformation)
[![Coverage Status](https://img.shields.io/coveralls/github/Sage-Bionetworks/synapseformation.svg?&label=coverage&logo=Coveralls)](https://coveralls.io/github/Sage-Bionetworks/synapseformation)
[![build](https://github.com/Sage-Bionetworks/synapseformation/actions/workflows/ci.yml/badge.svg)](https://github.com/Sage-Bionetworks/synapseformation/actions/workflows/ci.yml)

> [!WARNING]
> This package is not actively maintained and is an MVP. The functionality and dependencies may change at any time, but will follow semantic versioning guidelines. Use at your own risk.


Client for using [Synapse Formation Templates](templates). Given one of these templates, `synapseformation` will be able to create all the components required in a Synapse Project. Currently the implementation does one of these two scenarios.
Expand Down
44 changes: 44 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[metadata]
name = synapseformation
version = attr: synapseformation.__version__.__version__
description = Client for using Synapse Formation templates.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/Sage-Bionetworks/synapseformation
author = Thomas Yu
license = Apache-2.0
license_files = LICENSE
classifiers =
Development Status :: 5 - Production/Stable
Programming Language :: Python
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Operating System :: MacOS
Operating System :: Microsoft :: Windows
Operating System :: Unix
Operating System :: POSIX :: Linux
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Approved :: Apache Software License
Topic :: Software Development :: Libraries
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Bio-Informatics

project_urls =
Documentation = https://github.com/Sage-Bionetworks/synapseformation
Source Code = https://github.com/Sage-Bionetworks/synapseformation
Bug Tracker = https://github.com/Sage-Bionetworks/synapseformation/issues

[options]
packages = find:
python_requires = >=3.9, <3.12
zip_safe = False
install_requires =
click
synapseclient>=4.0.0
pyyaml

[options.entry_points]
console_scripts =
synapseformation = synapseformation.__main__:cli
54 changes: 2 additions & 52 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,53 +1,3 @@
"""Setup"""
import os
from setuptools import setup, find_packages
from setuptools import setup

# figure out the version
about = {}
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "synapseformation", "__version__.py")) as f:
exec(f.read(), about)

with open("README.md", "r") as fh:
long_description = fh.read()

setup(
name='synapseformation',
version=about["__version__"],
description='Client for using Synapse Formation templates.',
url='https://github.com/Sage-Bionetworks/synapseformation',
author='Kenneth Daily,Thomas Yu,Kelsey Montgomery',
license='Apache',
packages=find_packages(),
long_description=long_description,
long_description_content_type="text/markdown",
zip_safe=False,
python_requires='>=3.6',
entry_points={'console_scripts': ['synapseformation = synapseformation.__main__:cli']},
install_requires=['click',
'synapseclient>=2.4.0',
'pyyaml'],
project_urls={
"Documentation": "https://github.com/Sage-Bionetworks/synapseformation",
"Source Code": "https://github.com/Sage-Bionetworks/synapseformation",
"Bug Tracker": "https://github.com/Sage-Bionetworks/synapseformation/issues",
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: Unix',
'Operating System :: POSIX :: Linux',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Topic :: Software Development :: Libraries',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Bio-Informatics'
],
)
setup()
16 changes: 10 additions & 6 deletions synapseformation/__main__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
"""synapseformation command line client"""
import click

import synapseclient

from .__version__ import __version__
from .client import create_synapse_resources
from .utils import synapse_login
from .__version__ import __version__


def add_version(f):
Expand Down Expand Up @@ -38,10 +37,15 @@ def cli():


@cli.command()
@click.option('--template_path', help='Template path', type=click.Path())
@click.option('-c', '--config_path', help='Synapse configuration file',
type=click.Path(), show_default=True,
default=synapseclient.client.CONFIG_FILE)
@click.option("--template_path", help="Template path", type=click.Path())
@click.option(
"-c",
"--config_path",
help="Synapse configuration file",
type=click.Path(),
show_default=True,
default=synapseclient.client.CONFIG_FILE,
)
def create(template_path, config_path):
"""Creates Synapse Resources given a yaml or json"""
syn = synapse_login(synapse_config=config_path)
Expand Down
2 changes: 1 addition & 1 deletion synapseformation/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.3"
__version__ = "0.0.3"
Loading
Loading