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

Expand deps #127

Merged
merged 9 commits into from
Dec 13, 2024
Merged
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
81 changes: 81 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs_master.url = "github:NixOS/nixpkgs/master";
systems.url = "github:nix-systems/default";
flake-utils.url = "github:numtide/flake-utils";
flake-utils.inputs.systems.follows = "systems";
};

outputs = {
self,
nixpkgs,
flake-utils,
systems,
...
} @ inputs:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
system = system;
config.allowUnfree = true;
};

in
with pkgs; rec {
callPackage = lib.callPackageWith (pkgs // packages // python3Packages);

packages = {
centrosome = callPackage ./nix/centrosome.nix {};
};

devShells = {
default = let
python_with_pkgs = (pkgs.python3.withPackages(pp: [
packages.centrosome
]));
in
mkShell {
packages = [
python_with_pkgs
];
venvDir = "./.venv";
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
'';
postShellHook = ''
unset SOURCE_DATE_EPOCH
'';
shellHook = ''
runHook venvShellHook
export PYTHONPATH=${python_with_pkgs}/${python_with_pkgs.sitePackages}:$PYTHONPATH
'';
};
};
}
);
}
47 changes: 47 additions & 0 deletions nix/centrosome.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
lib,
# build deps
buildPythonPackage,
fetchFromGitHub,
pip,
setuptools,
# test deps
pytest,
cython,
# runtime deps
deprecation,
numpy,
scipy,
scikit-image,
}:
buildPythonPackage {
pname = "centrosome";
version = "1.3.0";

src = fetchFromGitHub {
owner = "afermg";
repo = "centrosome";
rev = "d9313e13c557264f8899f6bac3a5210e4580b40e";
sha256 = "sha256-ufCLHpYdC6XeWGIa4TulhuO08+ZtQ8iSZv0uGcRhZkQ=";
};
pyproject = true;
buildInputs = [
cython
pip
setuptools
];
propagatedBuildInputs = [
deprecation
numpy
scipy
scikit-image
pytest
];
pythonImportsCheck = [];

meta = {
description = "Centrosome";
homepage = "https://cellprofiler.org";
license = lib.licenses.bsd3;
};
}
27 changes: 10 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import absolute_import

import glob
import os.path
import sys
Expand Down Expand Up @@ -78,7 +79,7 @@ def run_tests(self):
]

if __suffix == "pyx":
__extensions = Cython.Build.cythonize(__extensions, compiler_directives={'language_level' : "3"})
__extensions = Cython.Build.cythonize(__extensions, compiler_directives={'language_level': "3"})

setuptools.setup(
author="Nodar Gogoberidze",
Expand All @@ -95,6 +96,7 @@ def run_tests(self):
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering",
],
Expand All @@ -107,20 +109,11 @@ def run_tests(self):
},
install_requires=[
"deprecation",
"matplotlib>=3.1.3,<3.8",
# we don't depend on this directly but matplotlib does
# and does not put an upper pin on it
# if removing upper pin on scikit-image here,
# then delete contourpy as a dependency as well
"contourpy<1.2.0",
"numpy>=1.18.2,<2",
"scikit-image>=0.17.2,<0.22.0",
# we don't depend on this directly but scikit-image does
# and does not put an upper pin on it
# if removing upper pin on scikit-image here,
# then delete PyWavelets as a dependency as well
"PyWavelets<1.5",
"scipy>=1.4.1,<1.11",
"matplotlib>=3.1.3,<4",
"numpy>=1.18.2,<3",
"pillow>=7.1.0,<12",
"scikit-image>=0.17.2,<=0.24",
"scipy>=1.4.1,!=1.11.0,<2",
],
tests_require=[
"pytest",
Expand All @@ -130,7 +123,7 @@ def run_tests(self):
long_description="",
name="centrosome",
packages=["centrosome"],
setup_requires=["cython", "numpy", "pytest",],
setup_requires=["cython", "numpy", "pytest", ],
url="https://github.com/CellProfiler/centrosome",
version="1.2.3",
version="1.3.0",
)
Loading