Closed prjemian closed 1 year ago
@rodolakis : Can you review these changes? The code here and in apstools needs other work to enable the choice of a constant log directory. (The fix we applied today won't work when the functions are called from apstools.utils.) I indicated what the fix will need to be with a TODO marking.
@rodolakis - Don't bother with the review yet. There is a problem with the upstream package requiring a fix in apstools:
if maxBytes > 0 or backupCount > 0:
> handler = logging.handlers.RotatingFileHandler(log_file, maxBytes=maxBytes, backupCount=backupCount)
E AttributeError: module 'logging' has no attribute 'handlers'. Did you mean: '_handlers'?
../../../micromamba-root/envs/anaconda-test-env-py-3.9/lib/python3.10/site-packages/apstools/utils/log_utils.py:64: AttributeError
Not sure I understand why Python 3.9 tests would be trying to run with Python 3.10 installation packages. Something wrong in the CI here at at least.
Marking this PR as draft for now.
Curious, most recent CI change is because Python 3.9 process was installing Python 3.10:
2023-03-23T21:21:32.5883378Z python 3.10.9 he550d4f_0_cpython conda-forge
Cannot test with Py3.11 yet:
error libmamba Could not solve for environment specs
The following packages are incompatible
├─ python 3.11** is installable with the potential options
│ ├─ python 3.11.0, which can be installed;
│ └─ python 3.11.0 would require
│ └─ python_abi 3.11.* *_cp311, which can be installed;
└─ tiled is uninstallable because it requires
├─ tiled-formats [0.1.0a65 hd8ed1ab_0|0.1.0a65 hd8ed1ab_1|...|0.1.0a75 hd8ed1ab_0], which requires
│ └─ tiled-base [>=0.1.0a.65,<0.1.1a |>=0.1.0a.66,<0.1.1a |...|>=0.1.0a.75,<0.1.1a ] but there are no viable options
│ ├─ tiled-base [0.1.0a77|0.1.0a79|...|0.1.0a[89](https://github.com/BCDA-APS/bluesky_training/actions/runs/4505458935/jobs/7931203294#step:3:91)] would require
│ │ └─ sparse >=0.13.0 , which requires
│ │ └─ numba >=0.49 but there are no viable options
│ │ ├─ numba [0.49.0|0.49.1|...|0.53.1] would require
│ │ │ ├─ python >=3.6,<3.7.0a0 , which conflicts with any installable versions previously reported;
│ │ │ └─ python_abi 3.6.* *_cp36m, which conflicts with any installable versions previously reported;
│ │ ├─ numba [0.49.0|0.49.1|...|0.56.3] would require
│ │ │ ├─ python >=3.7,<3.8.0a0 , which conflicts with any installable versions previously reported;
│ │ │ └─ python_abi 3.7.* *_cp37m, which conflicts with any installable versions previously reported;
│ │ ├─ numba [0.49.0|0.49.1|...|0.56.4] would require
│ │ │ ├─ python >=3.8,<3.9.0a0 , which conflicts with any installable versions previously reported;
│ │ │ └─ python_abi 3.8.* *_cp38, which conflicts with any installable versions previously reported;
│ │ ├─ numba [0.53.0|0.53.1|...|0.56.4] would require
│ │ │ ├─ python >=3.9,<3.10.0a0 , which conflicts with any installable versions previously reported;
│ │ │ └─ python_abi 3.9.* *_cp39, which conflicts with any installable versions previously reported;
│ │ ├─ numba [0.55.0|0.55.1|...|0.56.4] would require
│ │ │ ├─ python >=3.10,<3.11.0a0 , which conflicts with any installable versions previously reported;
│ │ │ └─ python_abi 3.10.* *_cp310, which conflicts with any installable versions previously reported;
│ │ ├─ numba [0.49.0|0.49.1|...|0.53.1] would require
│ │ │ └─ python >=3.6,<3.7.0a0 , which conflicts with any installable versions previously reported;
│ │ ├─ numba [0.49.0|0.49.1|...|0.56.4] would require
│ │ │ └─ python >=3.7,<3.8.0a0 , which conflicts with any installable versions previously reported;
│ │ ├─ numba [0.49.0|0.49.1|...|0.56.4] would require
│ │ │ └─ python >=3.8,<3.9.0a0 , which conflicts with any installable versions previously reported;
│ │ ├─ numba [0.53.0|0.53.1|...|0.56.4] would require
│ │ │ └─ python >=3.9,<3.10.0a0 , which conflicts with any installable versions previously reported;
│ │ └─ numba [0.55.0|0.55.1|0.56.3|0.56.4] would require
│ │ └─ python >=3.10,<3.11.0a0 , which conflicts with any installable versions previously reported;
│ ├─ tiled-base [0.1.0a65|0.1.0a66|...|0.1.0a75] would require
│ │ ├─ python >=3.10,<3.11.0a0 , which conflicts with any installable versions previously reported;
│ │ └─ python_abi 3.10.* *_cp310, which conflicts with any installable versions previously reported;
│ ├─ tiled-base [0.1.0a65|0.1.0a66|...|0.1.0a75] would require
│ │ ├─ python >=3.7,<3.8.0a0 , which conflicts with any installable versions previously reported;
│ │ └─ python_abi 3.7.* *_cp37m, which conflicts with any installable versions previously reported;
│ ├─ tiled-base [0.1.0a65|0.1.0a66|...|0.1.0a75] would require
│ │ ├─ python >=3.8,<3.9.0a0 , which conflicts with any installable versions previously reported;
│ │ └─ python_abi 3.8.* *_cp38, which conflicts with any installable versions previously reported;
│ └─ tiled-base [0.1.0a65|0.1.0a66|...|0.1.0a75] would require
│ ├─ python >=3.9,<3.10.0a0 , which conflicts with any installable versions previously reported;
│ └─ python_abi 3.9.* *_cp39, which conflicts with any installable versions previously reported;
└─ tiled-server [0.1.0a77 hd8ed1ab_0|0.1.0a79 hd8ed1ab_0|...|0.1.0a89 hd8ed1ab_0], which requires
└─ tiled-base [0.1.0a77 pyhd8ed1ab_0|0.1.0a79 pyhd8ed1ab_0|...|0.1.0a89 pyhd8ed1ab_0], which cannot be installed (as previously explained).
critical libmamba Could not solve for environment specs
Error: Failed to execute ["/home/runner/micromamba-bin/micromamba create -n anaconda-test-env-py-3.11 -y --log-level warning \"coveralls\" \"pytest\" \"pytest-cov\" \"python=3.11\" \"setuptools-scm\" -f /home/runner/work/bluesky_training/bluesky_training/environment.yml"]: Error: The process '/home/runner/micromamba-bin/micromamba' failed with exit code 1
/home/runner/work/_actions/mamba-org/provision-with-micromamba/main/dist/main/index.js:666[93](https://github.com/BCDA-APS/bluesky_training/actions/runs/4505458935/jobs/7931203294#step:3:95)
throw Error(`Failed to execute ${JSON.stringify(args)}: ${error}`)
That's tiled
. See if it can be pip
installed instead.
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Now the error is with the queueserver:
Might be related to the 0.0.18 release. Try dropping back to previous 0.0.17.
Py3.11 needs queueserver 0.0.18, so remove testing on Py3.11 for now.
Again, this error:
if maxBytes > 0 or backupCount > 0:
> handler = logging.handlers.RotatingFileHandler(log_file, maxBytes=maxBytes, backupCount=backupCount)
E AttributeError: module 'logging' has no attribute 'handlers'
../../../micromamba-root/envs/anaconda-test-env-py-3.9/lib/python3.9/site-packages/apstools/utils/log_utils.py:64: AttributeError
Yet the Python 3.9 documentation says that logging.handlers.RotatingFileHandler()
is available. So this might be an import problem (needing import logging.handlers
in apstools upstream?)?
Same problem found with Python 3.8.
Must apply fixes in apstools and make a new release there before continuing here. Ugh.
New apstools release 1.6.15 is available now. Re-run the CI.
First re-run did not get the newest apstools. Wait a few hours, then re-run.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
bluesky/instrument/session_logs.py | 10 | 11 | 90.91% | ||
<!-- | Total: | 10 | 11 | 90.91% | --> |
Totals | |
---|---|
Change from base Build 4504812792: | -0.2% |
Covered Lines: | 822 |
Relevant Lines: | 1028 |
Tested basic functionality and looks good.
$ ipython3
Python 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.11.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from instrument.collection import *
/home/beams2/TGURUSWAMY/src/python/bluesky/instrument/_iconfig.py
Activating auto-logging. Current session state plus future input saved.
Filename : /home/beams2/TGURUSWAMY/src/python/bluesky/.logs/ipython_console.log
...
$ vim instrument/iconfig.yml
$ ipython3
Python 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.11.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from instrument.collection import *
/home/beams2/TGURUSWAMY/src/python/bluesky/instrument/_iconfig.py
Activating auto-logging. Current session state plus future input saved.
Filename : /tmp/ipython_console.log
...