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

Add stanalyzer package #29365

Open
wants to merge 1 commit 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
1 change: 1 addition & 0 deletions recipes/stanalyzer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .install import finish_install
9 changes: 9 additions & 0 deletions recipes/stanalyzer/build_base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if [ "$PKG_NAME" == "stanalyzer-dev" ]; then
# just copy files necessary for post-installer
mkdir $SP_DIR/stanalyzer
cp $SRC_DIR/conda.build/install.py $SP_DIR/stanalyzer
cp $SRC_DIR/conda.build/__init__.py $SP_DIR/stanalyzer
else
export SETUPTOOLS_SCM_PRETEND_VERSION="$PKG_VERSION"
${PYTHON} -m pip install --no-deps --ignore-installed .
fi
8 changes: 8 additions & 0 deletions recipes/stanalyzer/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
python_min:
- "3.10"
numpy:
- 1.26
channel_sources:
- conda-forge
channel_targets:
- conda-forge stanalyzer_dev
56 changes: 56 additions & 0 deletions recipes/stanalyzer/install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import os
import sys

pip_e_URL = "https://pip.pypa.io/en/stable/topics/local-project-installs" +\
"/#editable-installs"
repo = "[email protected]:nk53/stanalyzer.git"


def _run_or_die(cmd):
if result := os.system(cmd):
print(cmd[:10], '... failed with status', result, file=sys.stderr)
print("Exiting...", file=sys.stderr)
sys.exit(result)


def finish_install():
saveas = 'stanalyzer'

prog, args = os.path.basename(sys.argv.pop(0)), sys.argv
match args:
case []:
print("This will clone the git repository and install it as an 'editable' package.")
print("Read here for more info:")
print(" ", pip_e_URL)
print()
try:
saveas = input(f"Desired repository save path (default: {saveas}): ") or saveas
except KeyboardInterrupt:
print()
sys.exit(1)
case '-q':
pass
case '-h' | '--help':
print(f"Usage: {prog} [-h] [-q | -p SAVE_PATH]", file=sys.stderr)
sys.exit(0)
case ['-p', saveas]:
pass
case _:
print(f"Usage: {prog} [-h] [-q | -p SAVE_PATH]", file=sys.stderr)
sys.exit(1)

cmds = [
f"git clone {repo} {saveas}",
f"pip install --no-deps --ignore-installed --editable {saveas}",
]

for cmd in cmds:
print("Running:", cmd)
_run_or_die(cmd)

print("Removing temporary stanalyzer dir from site-packages")
import stanalyzer
sta_dir = stanalyzer.__path__[0]
_run_or_die(f"rm -rv {sta_dir}")

print("Done")
114 changes: 114 additions & 0 deletions recipes/stanalyzer/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{%- set base = "stanalyzer" -%}
{%- set short = "sta" -%}
{%- set tag = "1.0.0dev1" -%}
{%- set version = tag|replace('-', '_') -%}


package:
name: {{ base }}-metapkg
version: {{ version }}

source:
url: https://github.com/nk53/stanalyzer/archive/refs/tags/v{{ tag }}.tar.gz
sha256: cff3a28af7defe0c335cf7ddee68fee7244dc918a63dd32985330fe655d09f25

build:
number: 0
noarch: python

requirements:
host:
- python ={{ python_min }}
- setuptools >=64
- setuptools_scm >=8
- pip

outputs:
- name: {{ base }}
script: build_base.sh
requirements:
build:
- python ={{ python_min }}
- setuptools >=64
- setuptools_scm >=8
- pip
run:
- python >={{ python_min }}
- mdanalysis =2.7
- paramiko =3.5
- fabric =3.2
- invoke =2.2
- pyyaml =6.0
- fastapi =0.115
- uvicorn =0.32
- jinja2 =3.1
- sqlmodel >=0.0.22
- email-validator =2.2
- python-multipart >=0.0.17
- numpy
run_constrained:
- hole2 =2.3
- freesasa =2.2
- dssp
entry_points:
- {{ base }} = {{ base }}.cli.{{ base }}:main
- {{ short }}-server = {{ base }}.cli.{{ base }}:run_server
test:
imports:
- {{ base }}
- {{ base }}.cli.{{ base }}
commands:
- {{ base }} -h
- {{ base }} system_size -h
- name: {{ base }}-dev
script: build_base.sh
requirements:
build:
- python ={{ python_min }}
- setuptools >=64
- setuptools_scm >=8
- pip
run:
- python >={{ python_min }}
- mdanalysis =2.7
- paramiko =3.5
- fabric =3.2
- invoke =2.2
- pyyaml =6.0
- pylsp-mypy =0.6
- sphinx =8.1
- sphinx-js =3.2
- fastapi =0.115
- uvicorn =0.32
- jinja2 =3.1
- sqlmodel >=0.0.22
- email-validator =2.2
- python-multipart >=0.0.17
run_constrained:
- hole2 =2.3
- freesasa =2.2
- dssp
entry_points:
- {{ base }} = {{ base }}.cli.{{ base }}:main
- {{ short }}-server = {{ base }}.cli.{{ base }}:run_server
- {{ short }}-finish-install = {{ base }}:finish_install
test:
imports:
- {{ base }}

about:
home: https://github.com/nk53/{{ base }}
license: MIT
license_file: LICENSE
license_url: https://github.com/nk53/{{ base }}/blob/{{ short }}/LICENSE
summary: Command-line and web interface for common simulation trajectory analysis
description: |
An extensible framework for analyzing molecular dynamics simulation trajectories. Several analysis programs are provided, and sophisticated users can add their own analysis types.
dev_url: https://github.com/nk53/{{ base }}
doc_url: https://github.com/nk53/{{ base }}/blob/{{ short }}/README.md
doc_source_url: https://github.com/nk53/{{ base }}/blob/{{ short }}/README.md

extra:
recipe-maintainers:
- nk53
feedstock-name: stanalyzer