Skip to content

Commit

Permalink
Conda build fixes (#391)
Browse files Browse the repository at this point in the history
* Tell pytest what the python path is

* Combine all developer requirements into environment.yml

* Drop support for rpms
  • Loading branch information
peterfpeterson authored Dec 15, 2022
1 parent 9785c52 commit e1d412b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 76 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,12 @@ jobs:
mamba-version: "*"
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
channels: neutrons,mantid/label/nightly,conda-forge

- name: Apt install deps
run: |
sudo apt update
sudo apt-get install xvfb freeglut3-dev libglu1-mesa
- name: Conda install deps
shell: bash -l {0}
run: mamba install --file requirements-dev.txt

- name: Mantid pre-requisites
shell: bash -l {0}
run: |
Expand All @@ -58,7 +53,6 @@ jobs:
- name: Test
shell: bash -l {0}
run: |
pip install py
python -c "import mantid"
python -c "import qtpy"
python -c "import mantidqt"
Expand All @@ -77,11 +71,11 @@ jobs:
shell: bash -l {0}
run: |
# set up environment
export VERSION=$(versioningit)
conda install -y anaconda-client conda-build conda-verify boa
cd conda.recipe
echo "versioningit $(versioningit ../)"
# build the package
conda mambabuild --output-folder . . -c neutrons -c mantid/label/nightly
VERSION=$(versioningit ../) conda mambabuild --output-folder . . -c neutrons -c mantid/label/nightly
conda verify noarch/addie*.tar.bz2
- name: Deploy to Anaconda
Expand Down
47 changes: 14 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
| CI | Release | Other |
|--------|---------|-------|
| [![GitHub Actions](https://github.com/neutrons/addie/actions/workflows/actions.yml/badge.svg?branch=master)](https://github.com/neutrons/addie/actions/workflows/actions.yml) | [![Anaconda-Server Badge](https://anaconda.org/neutrons/addie/badges/version.svg)](https://anaconda.org/neutrons/addie) | [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT) |
| | [![Anaconda-Server Badge](https://anaconda.org/neutrons/addie/badges/platforms.svg)](https://anaconda.org/neutrons/addie) |
| | [![Anaconda-Server Badge](https://anaconda.org/neutrons/addie/badges/platforms.svg)](https://anaconda.org/neutrons/addie) |



Expand Down Expand Up @@ -48,7 +48,7 @@ conda deactivate
conda remove -n addie_env --all
```

## Launch
## Launch

To launch ADDIE, run the following from the command line:

Expand All @@ -66,8 +66,9 @@ MANTIDPATH=/path/to/mantid/build/bin PATH=$MANTIDPATH:$PATH PYTHONPATH=$MANTIDPA


### Installation development environment using Conda
```
conda env create

```bash
conda env create --file environment.yml
conda activate addie
pip install -e .
```
Expand All @@ -76,29 +77,22 @@ This will use the configuration in the `environment.yml` file for setting up the
`addie` conda environment. If one needs to change the conda environment name,
simply edit the `addie` to something else in the `environment.yml` file.

An alternative way to set up a dev environment for ADDIE is to follow the steps
below,

```
conda config --add channels conda-forge
conda create -n addie_env
conda activate addie_env
pip install -e .
conda install mantidworkbench -c mantid/label/nightly
conda install -q -y -c neutrons mantid-total-scattering-python-wrapper
pip install https://oncat.ornl.gov/packages/pyoncat-1.5.1-py3-none-any.whl
```

Then suppose one is located in the main directory of the ADDIE repo, executing
the following command will start up ADDIE,

```
```bash
python addie/main.py
```

### Uninstall
or just

```bash
addie
```

### Uninstall

```bash
conda deactivate
conda remove -n addie --all
```
Expand Down Expand Up @@ -135,7 +129,7 @@ addie that way as well. After creating the virtual environment, run
```

which will add a file, `mantid.pth` to your environment with the
location of mantid. Then you need to setup for development:
location of mantid. Then you need to setup for development:

```bash
python setup.py develop
Expand All @@ -160,16 +154,3 @@ pipenv --two
echo layout_pipenv > .envrc
direnv allow
```

## Creating RPMs

Python generated `srpm` are not as flexible as they should be. To
generate one that is run `buildrpm` and look for the files in the
`dist` directory.
```bash
$ ./buildrpm
```
The `rpm`s are available on
[copr](https://copr.fedorainfracloud.org/coprs/peterfpeterson/addie/).


12 changes: 0 additions & 12 deletions buildrpm

This file was deleted.

10 changes: 9 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@ channels:
dependencies:
- build
- configparser
- flake8
- mantid-total-scattering-python-wrapper
- mantidworkbench
- mock
- periodictable
- psutil
- pystog
- setuptools
- pytest
- pytest-mpl
- pytest-qt
- qtpy
- setuptools>=48
- simplejson
- typing
- versioningit
- pip
- pip:
- https://oncat.ornl.gov/packages/pyoncat-1.5.1-py3-none-any.whl
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ distance-dirty = "{next_version}.dev{distance}+d{build_date:%Y%m%d%H%M}"

[tool.versioningit.write]
file = "addie/_version.py"

[tool.pytest.ini_options]
pythonpath = [
'.'
]
14 changes: 0 additions & 14 deletions requirements-dev.txt

This file was deleted.

8 changes: 0 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ exclude =
*.qrc
*.json

[bdist]
formats = rpm

[bdist_rpm]
requires = python, numpy, python-matplotlib, python-periodictable, PyQt5, mantidnightly
build_requires = python, python-setuptools, PyQt5, versioningit
doc_files = README.md

[flake8]
ignore = E114,E115,E116,E121,E123,E126,E133,E2,E704,E722,E741,E743,W503,F403,F405,F999
exclude = addie/icons/icons_rc.py
Expand Down

2 comments on commit e1d412b

@github-actions
Copy link

Choose a reason for hiding this comment

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

GitLab pipeline for addie-dev has been submitted for this commit: "https://code.ornl.gov/sns-hfir-scse/deployments/addie-deploy/-/pipelines/313905"

@github-actions
Copy link

Choose a reason for hiding this comment

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

GitLab pipeline for addie-qa has been submitted for this commit: "https://code.ornl.gov/sns-hfir-scse/deployments/addie-deploy/-/pipelines/313906"

Please sign in to comment.