Skip to content

Commit

Permalink
updated install setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sfarrens committed Oct 11, 2024
1 parent e31cd7c commit 1462605
Show file tree
Hide file tree
Showing 104 changed files with 45 additions and 35 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8]
python-version: [3.11]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout

- name: Install Linux dependencies
if: runner.os == 'Linux'
Expand All @@ -37,6 +37,7 @@ jobs:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
auto-activate-base: true
miniforge-version: latest

- name: Install package
shell: bash -l {0}
Expand All @@ -47,5 +48,5 @@ jobs:
shell: bash -l {0}
run: |
conda activate shapepipe-dev
python setup.py test
pytest
shapepipe_run -c example/config.ini
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[project]
name = "shapepipe"
version = "1.0.2"
description = "Galaxy shape measurement pipeline."
authors = [
{ name = "Samuel Farrens", email = "samuel.farrens@cea.fr" },
{ name = "Axel Guinot", email = "axel.guinot@cea.fr" },
{ name = "Martin Kilbinger", email = "martin.kilbinger@cea.fr" }
]
dependencies = [
"joblib>=0.13",
"modopt>=1.2",
"numpy>=1.14"
]

[project.optional-dependencies]
testing = [
"pytest",
"pytest-cov",
"pytest-pycodestyle",
"pytest-pydocstyle"
]

[project.scripts]
shapepipe_run = "shapepipe.shapepipe_run:main"

[tool.pytest.ini_options]
addopts = "--verbose --cov=shapepipe"
testpaths = ["shapepipe"]
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion shapepipe/__init__.py → src/shapepipe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@

__all__ = ['modules', 'pipeline', 'utilities']

from importlib.metadata import metadata, version
from . import *
from .info import __about__, __version__

__version__ = version("shapepipe")
__about__ = metadata("shapepipe").get("Summary")
29 changes: 2 additions & 27 deletions shapepipe/info.py → src/shapepipe/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,8 @@
import_fail = True
else:
import_fail = False


# Package Info
version_info = (1, 0, 1)
__version__ = '.'.join(str(c) for c in version_info)
__name__ = 'shapepipe'
__author__ = 'Samuel Farrens'
__email__ = 'samuel.farrens@cea.fr'
__about__ = (
'ShapePipe is a shape measurement pipeline developed with the'
+ 'CosmoStat lab at CEA Paris-Saclay.'
)
__setups__ = ['pytest-runner']
__installs__ = [
'joblib>=0.13',
'modopt>=1.2',
'numpy>=1.14'
]
__tests__ = [
'pytest',
'pytest-cov',
'pytest-pycodestyle',
'pytest-pydocstyle',
]
__scripts_dir__ = 'scripts'
__scripts_ext__ = ('.py', '.sh', '.bash')


from shapepipe import __version__

def shapepipe_logo(colour=False):
"""Get ShapePipe Logo.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import argparse as ap

from shapepipe.info import __version__, shapepipe_logo
from shapepipe import __version__
from shapepipe.info import shapepipe_logo
from shapepipe.modules import __module_list__


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions shapepipe/run.py → src/shapepipe/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

import sys
from datetime import datetime
from importlib.metadata import requires

from joblib import cpu_count
from modopt.interface.errors import catch_error
from modopt.interface.log import close_log, set_up_log

from shapepipe.info import __installs__, line, shapepipe_logo
from shapepipe.info import line, shapepipe_logo
from shapepipe.pipeline.args import create_arg_parser
from shapepipe.pipeline.config import create_config_parser
from shapepipe.pipeline.dependency_handler import DependencyHandler
Expand Down Expand Up @@ -172,9 +173,9 @@ def _check_dependencies(self):
Check that all pipeline dependencies have been installed.
"""
module_dep = self._get_module_depends('depends') + __installs__
module_dep = self._get_module_depends('depends') + [dep.split()[0] for dep in requires("ShapePipe") if "extra ==" not in dep]
module_exe = self._get_module_depends('executes')

module_dep += ['mpi4py'] if import_mpi else module_dep

dh = DependencyHandler(module_dep, module_exe)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1462605

Please sign in to comment.