Skip to content

Commit

Permalink
build: add pip dependencies (#233)
Browse files Browse the repository at this point in the history
 - fix some missing pip dependencies & update workflows & fix tests
  • Loading branch information
casperdcl authored May 28, 2024
1 parent 7926050 commit 4fc64e6
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 36 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/conda_build_and_publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
name: conda_build

name: conda
on:
release:
types: [published]
push:
branches: [ master ]
tags:
- '**'
pull_request:
branches: [ master ]

release: {types: [published]}
push: {branches: [master], tags: ['**']}
pull_request: {branches: [master]}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: publish-to-conda
uses: paskino/conda-package-publish-action@v1.4.4
- uses: actions/checkout@v4
with:
subDir: 'recipe'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }} # fix SHA
- uses: TomographicImaging/conda-package-publish-action@v2
with:
additional_apt_packages: libgl-dev
subDir: recipe
channels: '-c conda-forge -c ccpi -c paskino'
AnacondaToken: ${{ secrets.ANACONDA_TOKEN }}
publish: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
test_all: ${{(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')) || (github.ref == 'refs/heads/master')}}
convert_win: false
convert_osx: false
7 changes: 4 additions & 3 deletions .github/workflows/docs_build_and_publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: docs
on:
release:
types: [published]
Expand All @@ -13,13 +14,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
pre-build-command: python -m pip install --upgrade pip; pip install sphinx_rtd_theme
# Create an artifact of the html output.
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: DocumentationHTML
path: docs/build/html/
Expand All @@ -30,7 +31,7 @@ jobs:
if: github.ref == 'refs/heads/master'
steps:
- name: Download artifact of the html output.
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: DocumentationHTML
path: docs/build/html/
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ChangeLog

## vx.x.x
* fix some missing pip dependencies & update workflows & fix tests #233
* Edit registration-tab name from "Manual" to "Initial" #241
* Add automatic registration functionality #304
* Set empty pop-up menus for the main windows #217
Expand Down
12 changes: 3 additions & 9 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ source:
path: ../

build:
number: {{ GIT_DESCRIBE_NUMBER }}
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
noarch: python
preserve_egg_dir: False

entry_points:
- idvc = idvc.idvc:main

missing_dso_whitelist:
- /lib64/libc.so.6 # [linux]
- /lib64/libm.so.6 # [linux]
Expand All @@ -23,22 +21,18 @@ build:
- C:\Windows\System32\msvcrt.dll # [win]
- C:\Windows\System32\SHELL32.dll # [win]


test:
source_files:
- ./test

commands:
- python -c "import os; print ('TESTING IN THIS DIRECTORY' , os.getcwd())"
- python -c "import os; print('TESTING IN THIS DIRECTORY', os.getcwd())"
- python -m unittest discover test

requirements:

build:
- python
- numpy
- typing_extensions # [py<=37]

run:
- python
- numpy
Expand Down
24 changes: 17 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

def version2pep440(version):
'''normalises the version from git describe to pep440
https://www.python.org/dev/peps/pep-0440/#id29
'''
if version[0] == 'v':
Expand Down Expand Up @@ -55,12 +55,22 @@ def version2pep440(version):
f.write('version = \'{}\''.format(dversion))

setup(
name = "idvc",
description = 'CCPi DVC Configurator',
version = dversion,
packages = {'idvc', 'idvc.ui', 'idvc.utils'},
package_dir = {'idvc': os.path.join('src','idvc')},
package_data = {'idvc':['DVCIconSquare.png']},
name="idvc",
description='CCPi DVC Configurator',
version=dversion,
packages={'idvc', 'idvc.ui', 'idvc.utils'},
package_dir={'idvc': os.path.join('src','idvc')},
package_data={'idvc':['DVCIconSquare.png']},
install_requires=[
"scipy",
# "ccpi-viewer>=22.2.0", # TODO: put on pypi
"natsort",
"docopt",
"matplotlib",
# "openmp; platform_system=='Darwin'",
"qdarkstyle",
"vtk",
],
# metadata for upload to PyPI
author="Edoardo Pasca, Laura Murgatroyd",
author_email="edo.paskino@gmail.com",
Expand Down
4 changes: 4 additions & 0 deletions src/idvc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@

# Author: Laura Murgatroyd (UKRI-STFC)
# Author: Edoardo Pasca (UKRI-STFC)
try:
import ccpi.viewer
except ImportError as exc:
raise ImportError('Please `conda install "ccpi::ccpi-viewer>=22.2.0"`') from exc

0 comments on commit 4fc64e6

Please sign in to comment.