diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index be48f20..a751710 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -22,7 +22,7 @@ jobs: python-version: "3.11" architecture: "x64" - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: ~/.cache/pre-commit key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}- diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 6eb314a..016cece 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -19,24 +19,27 @@ jobs: if: "!contains(github.event.head_commit.message, 'ci skip')" env: RENV_PATHS_ROOT: ~/.local/share/renv + R_LIBS_USER: /home/runner/work/_temp/Library + R_PROFILE_USER: /home/runner/work/_temp/.Rprofile + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} strategy: fail-fast: false matrix: config: + - {name: '3.13', os: ubuntu-latest, python: '3.13', r: 'release'} + - {name: '3.12', os: ubuntu-latest, python: '3.12', r: 'release'} - {name: '3.11', os: ubuntu-latest, python: '3.11', r: 'release'} - {name: '3.10', os: ubuntu-latest, python: '3.10', r: 'release'} - {name: '3.9', os: ubuntu-latest, python: '3.9', r: 'release'} - - {name: '3.8', os: ubuntu-latest, python: '3.8', r: 'release'} - - {name: '3.7', os: ubuntu-latest, python: '3.7', r: 'oldrel'} steps: - name: Get current date id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -44,10 +47,17 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update -qq - sudo apt-get install -y pandoc gfortran libblas-dev liblapack-dev libedit-dev llvm-dev libcurl4-openssl-dev ffmpeg libhdf5-dev libfribidi-dev libharfbuzz-dev + sudo apt-get install -y \ + pandoc gfortran libblas-dev liblapack-dev libedit-dev llvm-dev \ + libcurl4-openssl-dev ffmpeg libhdf5-dev libfribidi-dev libharfbuzz-dev \ + libxml2-dev libssl-dev \ + libfontconfig1-dev libfreetype6-dev + + - name: Install pkg-config + run: sudo apt-get update && sudo apt-get install -y pkg-config - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.config.python }} @@ -57,6 +67,9 @@ jobs: with: r-version: ${{ matrix.config.r }} + - name: Set up Pandoc + uses: r-lib/actions/setup-pandoc@v2 + - name: Cache Python packages uses: pat-s/always-upload-cache@v2 with: @@ -68,14 +81,15 @@ jobs: uses: pat-s/always-upload-cache@v2 if: startsWith(runner.os, 'Linux') with: - path: ${{ env.RENV_PATHS_ROOT }} - key: ${{ runner.os }}-renv-${{ steps.setup-r.outputs.installed-r-version }}-${{ hashFiles('**/renv.lock') }}-${{ steps.date.outputs.date }} + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-R-${{ steps.setup-r.outputs.installed-r-version }}-${{ hashFiles('DESCRIPTION') }}-v2 restore-keys: | - ${{ runner.os }}-renv-${{ steps.setup-r.outputs.installed-r-version }}-${{ hashFiles('**/renv.lock') }}- - ${{ runner.os }}-renv-${{ steps.setup-r.outputs.installed-r-version }}- + ${{ runner.os }}-R-${{ steps.setup-r.outputs.installed-r-version }}-v2 - name: Install python tools run: | + # Ensure pip is properly installed + python -m ensurepip --upgrade || true python -m pip install --upgrade pip pip install --upgrade wheel setuptools @@ -84,23 +98,40 @@ jobs: pip install rpy2 echo "LD_LIBRARY_PATH=$(python -m rpy2.situation LD_LIBRARY_PATH):${LD_LIBRARY_PATH}" >> $GITHUB_ENV - - name: Install scprep - id: install-python-packages + - name: Install core R packages run: | - pip install --upgrade .[test] - python -c "import scprep" + install.packages(c("remotes", "devtools", "BiocManager"), repos = "https://cloud.r-project.org/") + shell: Rscript {0} + + - name: Install Bioconductor packages + run: | + BiocManager::install(c("splatter", "slingshot"), ask = FALSE, update = FALSE) + shell: Rscript {0} - - name: Install R packages - id: install-r-packages + - name: Install GitHub packages run: | - if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") - renv::restore() - renv::install("bioc::splatter") - renv::install("bioc::slingshot") - renv::install("github::dynverse/dyngen") - renv::install("github::dynverse/dynwrap") + remotes::install_github("dynverse/dyngen", upgrade = "never") + remotes::install_github("dynverse/dynwrap", upgrade = "never") shell: Rscript {0} + + - name: Verify R package installation + run: | + packages <- c("splatter", "slingshot", "dyngen", "dynwrap") + for (pkg in packages) { + if (!requireNamespace(pkg, quietly = TRUE)) { + stop(paste("Package", pkg, "failed to install")) + } + cat("✓ Package", pkg, "installed successfully\n") + } + shell: Rscript {0} + + - name: Install scprep + id: install-python-packages + run: | + python -m pip install --upgrade .[test] + python -c "import scprep" + - name: Run tests run: nose2 -vvv @@ -113,7 +144,7 @@ jobs: - name: Upload check results on fail if: failure() - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: ${{ matrix.config.name }}_results - path: check + path: check \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8081a63 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,89 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "scprep" +dynamic = ["version"] +description = "scprep" +authors = [ + {name = "Scott Gigante, Daniel Burkhardt and Jay Stanley, Yale University", email = "krishnaswamylab@gmail.com"} +] +license = {text = "Yale License"} +readme = "README.rst" +requires-python = ">=3.9" +dependencies = [ + "numpy>=1.26.0", + "scipy>=1.13.0", + "scikit-learn>=1.5.0", + "decorator>=4.3.0", + "pandas>=2.0.0", + "packaging", +] +keywords = [ + "big-data", + "computational-biology", +] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Framework :: Jupyter", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Natural Language :: English", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Scientific/Engineering :: Bio-Informatics", +] + +[tool.setuptools.dynamic] +version = {attr = "scprep.version.__version__"} + +[project.urls] +Homepage = "https://github.com/KrishnaswamyLab/scprep" +Repository = "https://github.com/KrishnaswamyLab/scprep" +Download = "https://github.com/KrishnaswamyLab/scprep/archive/v{version}.tar.gz" + +[project.optional-dependencies] +optional = [ + "fcsparser<0.2.5", + "tables", + "h5py", + "anndata", + "anndata2ri>=1.0.6", +] +test = [ + "nose", + "nose2", + "coverage", + "coveralls", + "parameterized", + "requests", + "packaging", + "mock", + "h5py", + "matplotlib>=3.0", + "rpy2>=3.4.3", + "black", + "fcsparser<0.2.5", + "tables", + "h5py", + "anndata", + "anndata2ri>=1.0.6", +] +doc = [ + "sphinx>=2.2,<2.4", + "sphinxcontrib-napoleon", + "ipykernel", + "nbsphinx", + "autodocsumm", +] + +[tool.setuptools.packages.find] \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index ad6e5b9..0000000 --- a/setup.py +++ /dev/null @@ -1,93 +0,0 @@ -from setuptools import find_packages -from setuptools import setup - -import os - -install_requires = [ - "numpy>=1.12.0", - "scipy>=0.18.1", - "scikit-learn>=0.19.1", - "decorator>=4.3.0", - "pandas>=0.25,<2.1", - "packaging", -] - -optional_requires = [ - "fcsparser<0.2.5", - "tables", - "h5py", - "anndata", - "anndata2ri>=1.0.6", -] - -test_requires = [ - "nose", - "nose2", - "coverage", - "coveralls", - "parameterized", - "requests", - "packaging", - "mock", - "h5py", - "matplotlib>=3.0", - "rpy2>=3.4.3", - "black", -] - -doc_requires = [ - "sphinx>=2.2,<2.4", - "sphinxcontrib-napoleon", - "ipykernel", - "nbsphinx", - "autodocsumm", -] - -version_py = os.path.join(os.path.dirname(__file__), "scprep", "version.py") -version = open(version_py).read().strip().split("=")[-1].replace('"', "").strip() - -readme = open("README.rst").read() - -setup( - name="scprep", - version=version, - description="scprep", - author="Scott Gigante, Daniel Burkhardt and Jay Stanley, Yale University", - author_email="krishnaswamylab@gmail.com", - packages=find_packages(), - license="GNU General Public License Version 3", - install_requires=install_requires, - python_requires=">=3.6", - extras_require={ - "test": test_requires + optional_requires, - "doc": doc_requires, - "optional": optional_requires, - }, - test_suite="nose2.collector.collector", - long_description=readme, - url="https://github.com/KrishnaswamyLab/scprep", - download_url="https://github.com/KrishnaswamyLab/scprep/archive/v{}.tar.gz".format( - version - ), - keywords=[ - "big-data", - "computational-biology", - ], - classifiers=[ - "Development Status :: 4 - Beta", - "Environment :: Console", - "Framework :: Jupyter", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "Natural Language :: English", - "Operating System :: MacOS :: MacOS X", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Topic :: Scientific/Engineering :: Bio-Informatics", - ], -)