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

change Python versions in test matrix #685

Merged
merged 28 commits into from
Jul 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c23d167
CI #673 change test matrix
prjemian Jul 30, 2022
26bf6e5
DOC #673
prjemian Jul 30, 2022
55d16d6
CI #673 move into archive
prjemian Jul 30, 2022
8fdd8d4
CI #673 disable temporarily
prjemian Jul 30, 2022
552d89d
CI #673 install the catalogs and verify
prjemian Jul 30, 2022
74f30de
CI #673 add missing key
prjemian Jul 30, 2022
9703955
CI #673 cache & restore catalog setup
prjemian Jul 30, 2022
aa704ee
CI #673 pwd matters
prjemian Jul 30, 2022
bca547b
CI #673 restore by name
prjemian Jul 30, 2022
df8d0e8
CI #673 where are they?
prjemian Jul 30, 2022
48f609c
CI #673 directory placement
prjemian Jul 30, 2022
248daf1
CI #673 control the archive content
prjemian Jul 31, 2022
174c527
CI #673 check the catalog
prjemian Jul 31, 2022
a17bbfb
CI #673 restore remainder of workflow
prjemian Jul 31, 2022
a68b08c
CI #673 links
prjemian Jul 31, 2022
7951c37
CI #673 rename archive, chop out commented code
prjemian Jul 31, 2022
8122c08
CI #673 show catalog length as databroker functional test
prjemian Jul 31, 2022
62d88ad
CI #673 pin mongoquery version
prjemian Jul 31, 2022
0193da6
CI #673 nsls2forge channel for newer mongoquery
prjemian Jul 31, 2022
5c82cdf
CI #673 repo priorities
prjemian Jul 31, 2022
1dccc6c
CI #673 flexible priorities
prjemian Jul 31, 2022
8c2eda7
CI 673 switch brnach of action to gain feature
prjemian Jul 31, 2022
9f35450
DOC #673 explain so correction isn't removed later
prjemian Jul 31, 2022
fb0731c
CI #673 sort `ls` in chrono
prjemian Jul 31, 2022
a69eefe
TST #673 apply diagnostics
prjemian Jul 31, 2022
769b071
TST #673 adjust the assertions
prjemian Jul 31, 2022
f28ad41
CI #673
prjemian Jul 31, 2022
b537b7d
CI #673 restore workflows
prjemian Jul 31, 2022
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
File renamed without changes.
File renamed without changes.
70 changes: 63 additions & 7 deletions .github/workflows/tests.yml → .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,63 @@ jobs:
run: |
flake8

install-catalogs:
name: Install & cache databroker catalogs
runs-on: ubuntu-latest
needs: lint

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/bluesky/databroker-pack.git@master

- name: Unpack
run: |
cd resources
bash ./unpack.sh
cd ..

- name: Directory Listings
run: |
ls -lAFghR ~/.local/
ls -lAFghR /tmp/*_test/

- name: Prepare archival content
run: |
mkdir -p ~/databroker_catalogs/
mv ~/.local ~/databroker_catalogs/
mv /tmp/*_test ~/databroker_catalogs/

- name: Archive catalog artifacts
uses: actions/upload-artifact@v3
with:
name: databroker_catalogs
path: ~/databroker_catalogs

test-matrix:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
needs: lint
needs: install-catalogs
strategy:
matrix:
# python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9']
python-version: ['3.8', '3.9', '3.10']
max-parallel: 5

steps:
- uses: actions/checkout@v2

- name: Create Python ${{ matrix.python-version }} environment
uses: mamba-org/provision-with-micromamba@v12
uses: mamba-org/provision-with-micromamba@main
# use main branch to enable choice of channel-priority
with:
cache-env: true
cache-env-key: env-key-${{ matrix.python-version }}
channel-priority: flexible
environment-file: environment.yml
environment-name: anaconda-test-env-py-${{ matrix.python-version }}
extra-specs: |
Expand All @@ -68,6 +107,9 @@ jobs:
micromamba env list
printenv | sort

- name: Directories before Docker
run: ls -lAFghrt ~/

- name: Start EPICS IOCs in Docker
run: |
bash ./.github/scripts/start_xxx.sh gp
Expand All @@ -76,6 +118,9 @@ jobs:
ls -lAFgh /tmp/docker_ioc/iocad/
ls -lAFgh /tmp/docker_ioc/iocgp/

- name: Directories after Docker
run: ls -lAFghrt ~/

- name: Confirm EPICS IOC is available via caget
shell: bash -l {0}
run: |
Expand All @@ -97,17 +142,28 @@ jobs:
CMD+="; print(up.get())"
python -c "${CMD}"

- name: install test data catalogs
shell: bash -l {0}
- name: Download catalog artifacts
uses: actions/download-artifact@v3
with:
name: databroker_catalogs
path: ~/databroker_catalogs

- name: Restore archival content
run: |
./resources/unpack.sh
mkdir -p ~/.local/share/intake
mv ~/databroker_catalogs/.local/share/intake/* ~/.local/share/intake
mv ~/databroker_catalogs/*_test /tmp/

- name: Diagnostics
shell: bash -l {0}
run: |
df -HT
micromamba list

- name: Test catalog length, expect 53
shell: bash -l {0}
run: python -c "import databroker; print(len(databroker.catalog['apstools_test']))"

- name: Run tests with pytest & coverage
shell: bash -l {0}
run: |
Expand Down
17 changes: 13 additions & 4 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,20 @@ Change History
The project `milestones <https://github.com/BCDA-APS/apstools/milestones>`_
describe the future plans.

..
1.6.3
******
1.6.3
******

release expected by 2022-08-31

Maintenance
---------------

* Unit tests now Python version 3.8, 3.9, & 3.10.

Deprecations
---------------

release expected by 2022-08-31
* Drop support for Python 3.7.

1.6.2
******
Expand Down
2 changes: 1 addition & 1 deletion apstools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
__platforms__ = "any"
__zip_safe__ = False
__exclude_project_dirs__ = "docs resources".split()
__python_version_required__ = ">=3.7, <3.10"
__python_version_required__ = ">=3.8, <3.11"

__package_name__ = __project__
__long_description__ = __description__
Expand Down
22 changes: 10 additions & 12 deletions apstools/callbacks/tests/test_filewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,27 +164,25 @@ def test_NXWriter_make_file_name(tempdir):
assert callback.uid is None

with pytest.raises(TypeError) as exinfo:
# error from f"-S{self.scan_id:05d}"
callback.make_file_name()
assert (
"an integer is required (got type NoneType)"
in str(exinfo.value)
)
callback.start_time = 1000 # 1969-12-31T18:16:40
assert exinfo is not None
assert "NoneType" in str(exinfo.value), f"{callback=} {exinfo=}"
assert "an integer" in str(exinfo.value), f"{callback=} {exinfo=}"

callback.start_time = 1000 # 1969-12-31T18:16:40
with pytest.raises(TypeError) as exinfo:
# error from datetime.datetime.fromtimestamp
callback.make_file_name()
assert (
"unsupported format string passed to NoneType.__format__"
==
str(exinfo.value)
)
callback.scan_id = 9876
expected = "unsupported format string passed to NoneType.__format__"
assert expected == str(exinfo.value)

callback.scan_id = 9876
with pytest.raises(TypeError) as exinfo:
callback.make_file_name()
assert "'NoneType' object is not subscriptable" == str(exinfo.value)
callback.uid = "012345678901234567890123456789"

callback.uid = "012345678901234567890123456789"
fname = callback.make_file_name()
# https://github.com/BCDA-APS/apstools/issues/345
tz_aps = dateutil.tz.gettz("America/Chicago")
Expand Down
7 changes: 5 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
name: apstoolsdoc
name: apstools-test-environment

channels:
- conda-forge
- defaults
# nsls2forge channel for newer mongoquery 1.3.6 (issue #673)
- nsls2forge

dependencies:
- python >=3.7, <3.10
- python >=3.8, <3.11
- area-detector-handlers
- bluesky >=1.6.7
- databroker =1.2
- databroker-pack
- h5py
- intake
- mongoquery >=1.3.6
- openpyxl
- ophyd >=1.6.1
- pandas
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ bluesky>=1.6.2
databroker==1
databroker-pack
h5py
mongoquery>=1.3.6
numpy
ophyd>=1.5.1
openpyxl
Expand Down