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 calibration-services package #3

Open
wants to merge 3 commits into
base: master
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 .github/spack-config/spack.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
spack:
specs:
- crystfel
- py-calibration-services
- py-cfelpyutils
- py-extra-data
- py-extra-geom
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/package-test.py-calibration-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: py-calibration-services

on:
push:
branches: [ master ]
paths: ['packages/py-calibration-services/**']
pull_request:
branches: [ master ]
paths: ['packages/py-calibration-services/**']

jobs:
package-test-py-calibration-services:
runs-on: ubuntu-latest
container:
image: roscarxfel/spack-repo-testenv:latest
steps:
- uses: actions/checkout@v2
- run: |
source /opt/spack/share/spack/setup-env.sh
echo Spack version: $(spack --version)
echo Tests for package py-calibration-services
spack repo add --scope=site ./
spack install --test=root --verbose py-calibration-services
77 changes: 77 additions & 0 deletions packages/py-calibration-services/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

# ----------------------------------------------------------------------------
# If you submit this package back to Spack as a pull request,
# please first remove this boilerplate and all FIXME comments.
#
# This is a template package file for Spack. We've put "FIXME"
# next to all the things you'll want to change. Once you've handled
# them, you can save this file and test your package like this:
#
# spack install py-karabo-bridge
#
# You can edit this file again by typing:
#
# spack edit py-karabo-bridge
#
# See the Spack documentation for more information on packaging.
# ----------------------------------------------------------------------------

from spack import *


class PyCalibrationServices(PythonPackage):
"""Library from European XFEL."""

# FIXME: Add a proper url for your package's homepage here.
homepage = "https://git.xfel.eu/gitlab/dataAnalysis/calibration-services"
url = "https://git.xfel.eu/gitlab/dataAnalysis/calibration-services/-/archive/dev/calibration-services-dev.tar.gz"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulling in code from our private gitlab repository won't work unless the repo is set to public (which this one isn't).

There are ways around this which I can set up, in the end we'll probably just have two spack repositories: one on GitHub which has all our open source software on it, and one on GitLab with everything that isn't on GitHub.


# FIXME: Add a list of GitHub accounts to
# notify when the package is updated.
maintainers = ['daviddoji']
install_time_test_callbacks = ['import_module_test']

version('0.1.0', sha256='8c2da949587a730d1e26e2da7de713d38619a08bc3d058f6587a2b01848b6233')

# FIXME: Add dependencies if required.
depends_on('[email protected]:', type=('build', 'run'))
depends_on('py-setuptools', type='build')
depends_on('[email protected]:')
depends_on('[email protected]:')
depends_on('[email protected]:')
depends_on('[email protected]:')
Comment on lines +45 to +46
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These to dependencies are missing, I can work on adding them in when I have time though.

depends_on('[email protected]:')
depends_on('[email protected]:')
depends_on('py-iminuit')
depends_on('[email protected]:')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The py-pyfai package provided in this repository isn't finished yet so this won't work until I get around to figuring out the setup steps for that.


depends_on ('py-coverage', type='test')
depends_on ('py-dask', type='test')
# depends_on ('py-nbval', type='test') # Doesn't seem to be needed?
depends_on ('py-pytest', type='test')
depends_on ('py-pytest-cov', type='test')
depends_on ('py-testpath', type='test')

def test(self):
# `setup.py test` should not be used as:
# - `python3 -m pytest -v` should be ran instead
# - the builtin `test` method runs before `install` is finished
pass

@run_after('install')
def pytest(self):
with working_dir('.'):
prefix = self.spec.prefix
# Add bin to path here, as tests also check entrypoints
env['PATH'] = env['PATH']+":"+prefix+"/bin"
python('-m', 'pytest', '-v')

def build_args(self, spec, prefix):
# FIXME: Add arguments other than --prefix
# FIXME: If not needed delete this function
args = []
return args