diff --git a/.github/workflows/cdci.yml b/.github/workflows/cdci.yml new file mode 100644 index 0000000..cc00de9 --- /dev/null +++ b/.github/workflows/cdci.yml @@ -0,0 +1,77 @@ +name: Python package + +on: + push: + branches: [main] + pull_request: + branches: [main] + release: + types: [published] + +jobs: + # format: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: psf/black@stable + # lint: + # name: Lint with ruff + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + + # - uses: actions/setup-python@v5 + # with: + # python-version: "3.11" + # - name: Install ruff + # run: | + # pip install ruff + # - name: Lint with ruff + # run: | + # # stop the build if there are Python syntax errors or undefined names + # ruff check . + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' # caching pip dependencies + cache-dependency-path: '**/pyproject.toml' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + pip install -e . + # - name: Run tests + # run: python -m pytest tests + + + + publish: + name: Publish package + if: startsWith(github.ref, 'refs/tags') + permissions: + id-token: write + needs: + - test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Install twine and build + run: python -m pip install --upgrade twine build + - name: Build + run: python -m build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2edb025 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,68 @@ +[project] +authors = [{ name = "Alberto Santos Delgado", email = "albsad@dtu.dk" }, + { name = "Henry Webel", email = "heweb@dtu.dk"}] +name = "vuecore" +dynamic = ["version"] +description = "A Python package for plotting related to multimodal molecular data. Works with acore." +license = { text = "GNU General Public License v3" } +readme = "README.md" +requires-python = ">=3.9" +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Natural Language :: English", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] + +dependencies = [ + "numpy", + "pandas", + # "dsp-pandas", # has only pandas related dependencies + "scipy", + "plotly", + # "biopython", + "beautifulsoup4", + "requests", + "dash", # from dash import html + # "networkx", + "matplotlib", + # "cy-jupyterlab", + # "nltk", + # "webweb" + # "acore", +] + +[project.optional-dependencies] +docs = [ + "sphinx", + "sphinx-book-theme", + "myst-nb", + "ipywidgets", + "sphinx-new-tab-link!=0.2.2", + "jupytext", +] +dev = [ + "black", + "flake8", + "ruff", + "isort", + "pytest", + "pytest-cov", + "twine", + "wheel", + "jupytext", + "ipykernel", +] + +[project.urls] +Homepage = "https://github.com/Multiomics-Analytics-Group/vuecore" +Issues = "https://github.com/Multiomics-Analytics-Group/vuecore/issues" +Documentation = "https://analytics-core.readthedocs.io/" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..a631a80 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,10 @@ +[flake8] +exclude = docs +max-line-length = 90 +aggressive = 2 + +[tool:pytest] +addopts = --ignore=setup.py + +[isort] +profile=black diff --git a/setup.py b/setup.py index 1555862..b07c774 100644 --- a/setup.py +++ b/setup.py @@ -1,54 +1,5 @@ -# builtin -import setuptools +from setuptools import setup -def get_long_description(): - with open("README.md", "r") as readme_file: - long_description = readme_file.read() - return long_description - - -def get_requirements(): - with open('requirements.txt') as f: - required = f.read().splitlines() - return required - - -def create_pip_wheel(): - requirements = get_requirements() - setuptools.setup( - name="acore", - version="0.1.0", - license="MIT", - description="An open-source Python package for Statistical Analysis of Omics datasets", - long_description=get_long_description(), - long_description_content_type="text/markdown", - author="Multi-omics Network Analytics lab", - author_email="albsad@dtu.dk", - url="", - project_urls={ - "Multi-omics Network Analytics": "", - "GitHub": "", - "ReadTheDocs": "", - "PyPi": "", - "Scientific paper": "https://www.nature.com/articles/s41587-021-01145-6", - }, - keywords=["statistics", "bioinformatics", "multi-omics",], - classifiers=[ - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Topic :: Scientific :: Bioinformatics", - ], - packages=[ - "acore", - ], - include_package_data=True, - entry_points={}, - install_requires=requirements, - python_requires=">=3.9,<4", - ) - - -if __name__ == "__main__": - create_pip_wheel() +setup( + zip_safe=False, +) diff --git a/vcore/Dendrogram.py b/src/vuecore/Dendrogram.py similarity index 100% rename from vcore/Dendrogram.py rename to src/vuecore/Dendrogram.py diff --git a/src/vuecore/__init__.py b/src/vuecore/__init__.py new file mode 100644 index 0000000..df67852 --- /dev/null +++ b/src/vuecore/__init__.py @@ -0,0 +1,3 @@ +from importlib import metadata + +__version__ = metadata.version("vuecore") diff --git a/vcore/color_list.py b/src/vuecore/color_list.py similarity index 100% rename from vcore/color_list.py rename to src/vuecore/color_list.py diff --git a/vcore/utils.py b/src/vuecore/utils.py similarity index 100% rename from vcore/utils.py rename to src/vuecore/utils.py diff --git a/vcore/viz.py b/src/vuecore/viz.py similarity index 100% rename from vcore/viz.py rename to src/vuecore/viz.py diff --git a/vcore/wgcnaFigures.py b/src/vuecore/wgcnaFigures.py similarity index 100% rename from vcore/wgcnaFigures.py rename to src/vuecore/wgcnaFigures.py diff --git a/vcore/__init__.py b/vcore/__init__.py deleted file mode 100644 index e69de29..0000000