Commit dfa7e96f authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

ENH: Example python project/recipe

parent f8f62fa8
#!/usr/bin/env python
import os.path as op
import sys
def main():
scriptname = op.basename(sys.argv[0])
if len(sys.argv) != 2:
print(f'Usage: {scriptname} name')
sys.exit(1)
print(f'Hello, {sys.argv[1]}')
if __name__ == '__main__':
main()
#!/usr/bin/env python
from setuptools import setup
setup(name='example_python_project',
version='0.0.1',
description='Example FSL Python project',
author='Paul McCarthy',
install_requires=['numpy', 'nibabel'],
packages=['example_package'],
entry_points={
'console_scripts' : [
'example_python_exe = example_package.main:main',
]
}
)
# This is a FSL conda recipe for: example_python_project
# The project git repository is: https://git.fmrib.ox.ac.uk/fsl/example_python_project
# The git repository for this conda recipe is: https://git.fmrib.ox.ac.uk/fsl/conda/fsl-example_python_project
{% set name = fsl-example_python_project %}
{% set version = 0.0.1 %}
{% set repository = https://git.fmrib.ox.ac.uk/fsl/example_cpp_project %}
{% set build = '0' %}
package:
name: {{ name }}
version: {{ version }}
source:
# the FSLCONDA_REPOSITORY and FSLCONDA_REVISION
# environment variables can be used to override
# the repository/revision for development purposes.
git_url: {{ '{{ os.environ.get("FSLCONDA_REPOSITORY", repository) }}' }}
git_rev: {{ '{{ os.environ.get("FSLCONDA_REVISION", version) }}' }}
build:
number: {{ build }}
noarch: python
script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
requirements:
host:
- python
- pip
build:
- setuptools
- wheel
run
- fsl-base >=2012.0
- nibabel
- numpy
if [ -e ${FSLDIR}/share/fsl/sbin/createFSLWrapper ]; then
${FSLDIR}/share/fsl/sbin/createFSLWrapper example_python_exe
fi
if [ -e ${FSLDIR}/share/fsl/sbin/removeFSLWrapper ]; then
${FSLDIR}/share/fsl/sbin/removeFSLWrapper example_python_exe
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment