Skip to content

Commit

Permalink
Merge pull request #5 from hz-b/dev/feature/ci-package-install
Browse files Browse the repository at this point in the history
[TASK] use simplified installation
  • Loading branch information
Sulimankhail authored Jul 12, 2024
2 parents c0c8376 + 501dba6 commit c377fb0
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 121 deletions.
33 changes: 11 additions & 22 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,32 @@ jobs:

runs-on: ubuntu-latest
strategy:
fail-fast: True
fail-fast: False
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
with:
submodules: True
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
**/setup.cfg
**/pyproject.toml
**/requirements*.txt
- name: Install dependencies
- name: Install dependencies and packages
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip wheel setuptools
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# deliberatly not installing core/archiver
# needs some extra steps. should be loaded from pypi
# mls bluesky not yet a package
for tdir in core/math-utils core/device-models core/analysis \
custom/bact-bessyii-mls-ophyd \
custom/mls/ophyd \
custom/bessyii/ophyd custom/bessyii/bluesky \
custom/bessyii/analysis custom/bessyii/bessyii-dashboard
do
pushd $tdir
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip3 install .
popd
done
# deliberatly omitting the archiver
python -m pip install `python list_package_names.py | grep -v archiver`
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
12 changes: 10 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ BACT: Berlin Accelerator Control Toolkit

Publishing code soon. stay tuned.


HAve a look to the status page of the `subpackages dashboard`_

.. _`subpackages dashboard` : subpackages_dashboard.md
Following other package belong to this toolkit
----------------------------------------------

Expand Down Expand Up @@ -57,9 +63,11 @@ Now you should have an active virtual environment. Run

.. code-block:: shell
python3 development_install.py
python -m pip install `python list_package_names.py | grep -v archiver`
should install all required packages in your virtual environment.
should install all required packages in your virtual environment. Please note this
will not install the archiver module, as it requires some prerequisites for building
its core. Please have a look to the directory `archiver/core` how to install it.


Running orbit response matrix example
Expand Down
1 change: 0 additions & 1 deletion custom/mls/archiver
Submodule archiver deleted from 9becfb
96 changes: 0 additions & 96 deletions development_install.py

This file was deleted.

30 changes: 30 additions & 0 deletions list_package_names.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import glob
import os
import subprocess
from itertools import count
from typing import Sequence


def find_package_dirs(t_dir: str):
"""Find directories containing setup.py or pyproject.toml files"""
pyproject_files = glob.glob(f"{t_dir}**/pyproject.toml", recursive=True)
setup_files = glob.glob(f"{t_dir}/**/setup.py", recursive=True)
package_dirs = set()

for file_path in pyproject_files:
package_dirs.add(os.path.dirname(file_path))

for file_path in setup_files:
package_dirs.add(os.path.dirname(file_path))

return package_dirs


def main():
"""Traverse directories listing the suitable ones"""
package_dirs = list(find_package_dirs("core/")) + list(find_package_dirs("custom/"))
print("\n".join([f"{t_dir}/" for t_dir in package_dirs]))


if __name__ == "__main__":
main()
25 changes: 25 additions & 0 deletions subpackages_dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Status of subpackages

| Subpackage | status |
|------------|--------|
| **core** | |
| [math utils](https://github.com/hz-b/bact-math-utils/) | [![CI](https://github.com/hz-b/bact-math-utils/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-math-utils/actions/workflows/python-package.yml) |
| [device models](https://github.com/hz-b/bact-device-models/) | [![CI](https://github.com/hz-b/bact-device-models/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-device-models/actions/workflows/python-package.yml) |
| [analysis](https://github.com/hz-b/bact-analysis/) | [![CI](https://github.com/hz-b/bact-analysis/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-analysis/actions/workflows/python-package.yml) |
| [archiver](https://github.com/hz-b/bact-archiver/) | [![CI](https://github.com/hz-b/bact-archiver/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-archiver/actions/workflows/python-package.yml) |
| **custom** | |
| **common for BESSY II and MLS** | |
| [ophyd](https://github.com/hz-b/bact-bessyii-mls-ophyd/) | [![CI](https://github.com/hz-b/bact-bessyii-mls-ophyd/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-bessyii-mls-ophyd/actions/workflows/python-package.yml) |
| **BESSY II** | |
| [ophyd](https://github.com/hz-b/bact-bessyii-ophyd/) | [![CI](https://github.com/hz-b/bact-bessyii-ophyd/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-bessyii-ophyd/actions/workflows/python-package.yml) |
| [bluesky](https://github.com/hz-b/bact-bessyii-bluesky/) | [![CI](https://github.com/hz-b/bact-bessyii-bluesky/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-bessyii-bluesky/actions/workflows/python-package.yml) |
| [analysis](https://github.com/hz-b/bact-analysis-bessyii/) | [![CI](https://github.com/hz-b/bact-analysis-bessyii/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-analysis-bessyii/actions/workflows/python-package.yml) |
| [archiver](https://github.com/hz-b/bact-archiver-bessyii/) | [![CI](https://github.com/hz-b/bact-archiver-bessyii/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-archiver-bessyii/actions/workflows/python-package.yml) |
| [dashboard](https://github.com/hz-b/bessyii-dashboard/) | [![CI](https://github.com/hz-b/bessyii-dashboard/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bessyii-dashboard/actions/workflows/python-package.yml) |
| **MLS** | |
| [ophyd](https://github.com/hz-b/bact-mls-ophyd/) | [![CI](https://github.com/hz-b/bact-mls-ophyd/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-mls-ophyd/actions/workflows/python-package.yml) |
| [bluesky](https://github.com/hz-b/bact-mls-bluesky) | [![CI](https://github.com/hz-b/bact-mls-bluesky/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-mls-bluesky/actions/workflows/python-package.yml) |
| [archiver](https://github.com/hz-b/bact-mls-archiver/) | [![CI](https://github.com/hz-b/bact-mls-archiver/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-mls-archiver/actions/workflows/python-package.yml) |
| **bPro** | |
| [archiver](https://github.com/hz-b/bact-archiver-bpro/) | [![CI](https://github.com/hz-b/bact-archiver-bpro/actions/workflows/python-package.yml/badge.svg)](https://github.com/hz-b/bact-archiver-bpro/actions/workflows/python-package.yml) |

0 comments on commit c377fb0

Please sign in to comment.