diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 0a4936db..83b1ed3c 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -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: | @@ -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" @@ -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 diff --git a/README.md b/README.md index 4a027def..aab1cf37 100644 --- a/README.md +++ b/README.md @@ -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) | @@ -48,7 +48,7 @@ conda deactivate conda remove -n addie_env --all ``` -## Launch +## Launch To launch ADDIE, run the following from the command line: @@ -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 . ``` @@ -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 ``` @@ -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 @@ -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/). - - diff --git a/buildrpm b/buildrpm deleted file mode 100755 index 470df341..00000000 --- a/buildrpm +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -python setup.py bdist_rpm --spec-only -patch dist/addie.spec addie.spec.patch - -python setup.py pyuic -python setup.py sdist -mkdir -p ~/rpmbuild/SOURCES/ -cp dist/addie-*.tar.gz ~/rpmbuild/SOURCES/ - -rpmbuild -ba dist/addie.spec -cp ~/rpmbuild/SRPMS/addie-*.src.rpm dist/ -cp ~/rpmbuild/RPMS/noarch/addie-*.noarch.rpm dist/ diff --git a/environment.yml b/environment.yml index 2f9d2f24..2179373f 100644 --- a/environment.yml +++ b/environment.yml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index e7aa3c48..c1d5770c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ + '.' + ] diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 3cfc99d5..00000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,14 +0,0 @@ -build -flake8 -mock -periodictable -psutil -pystog -qtpy -simplejson -pytest -pytest-mpl -pytest-qt<=3.3.0 -setuptools>=48 -typing -versioningit diff --git a/setup.cfg b/setup.cfg index dbbab857..634799be 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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