Becksteinlab / kda

Python package used for the analysis of biochemical kinetic diagrams.
GNU General Public License v3.0
5 stars 1 forks source link

make a release #70

Closed orbeckst closed 8 months ago

orbeckst commented 1 year ago

For the paper we should have

orbeckst commented 1 year ago

If you have any questions on how to do any of this, ask @ianmkenney , he has lots of experience!

nawtrey commented 1 year ago

I made a new release, but I cannot update the binaries on PyPi as there is an issue with my account. It looks like that may take a week or more to resolve, but when I get access I can update PyPi.

orbeckst commented 1 year ago

Ok... add me (=Oliver.Beckstein on pypi) as a co-maintainer next time so that at least one person has keys.

nawtrey commented 8 months ago

Started working on this again, and I ran into an issue when running the tests locally.

Here is the procedure I was following:

KDA PyPi Test/Upload Procedure ``` # Loosely follow GromacsWraper instructions Link: https://github.com/Becksteinlab/GromacsWrapper/wiki/Preparing-a-release # create a fresh conda env conda create --name kda_fresh python=3.11 conda activate kda_fresh # install pip, twine python -m pip install -U pip twine # clone the repo in a local directory git clone git@github.com:Becksteinlab/kda.git # install KDA and run the tests cd kda python setup.py install python setup.py test ```

Here is the test output:

Test output ``` $ python setup.py test C:\Users\nikol\Anaconda3\envs\kda_fresh\Lib\site-packages\setuptools\__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !! ******************************************************************************** Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. ******************************************************************************** !! dist.fetch_build_eggs(dist.setup_requires) C:\Users\nikol\Anaconda3\envs\kda_fresh\Lib\site-packages\setuptools\dist.py:314: InformationOnly: Normalizing 'v0.2.0+4.g533d243' to '0.2.0+4.g533d243' self.metadata.version = self._normalize_version( running pytest C:\Users\nikol\Anaconda3\envs\kda_fresh\Lib\site-packages\setuptools\command\test.py:193: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !! ******************************************************************************** Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. ******************************************************************************** !! ir_d = dist.fetch_build_eggs(dist.install_requires) C:\Users\nikol\Anaconda3\envs\kda_fresh\Lib\site-packages\setuptools\command\test.py:194: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !! ******************************************************************************** Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. ******************************************************************************** !! tr_d = dist.fetch_build_eggs(dist.tests_require or []) C:\Users\nikol\Anaconda3\envs\kda_fresh\Lib\site-packages\setuptools\command\test.py:195: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !! ******************************************************************************** Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. ******************************************************************************** !! er_d = dist.fetch_build_eggs( running egg_info writing kda.egg-info\PKG-INFO writing dependency_links to kda.egg-info\dependency_links.txt writing requirements to kda.egg-info\requires.txt writing top-level names to kda.egg-info\top_level.txt reading manifest file 'kda.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '__pycache__' found anywhere in distribution warning: no previously-included files matching '*.so' found anywhere in distribution adding license file 'LICENSE' writing manifest file 'kda.egg-info\SOURCES.txt' running build_ext ============================= test session starts ============================= platform win32 -- Python 3.11.8, pytest-8.0.2, pluggy-1.4.0 rootdir: C:\Users\nikol\OneDrive\projects\kinetic_diagram_analysis\packages\kda plugins: cov-4.1.0, xdist-3.5.0, hypothesis-6.98.17 collected 21 items / 1 error =================================== ERRORS ==================================== ___________________ ERROR collecting kda/tests/test_kda.py ____________________ kda\tests\test_kda.py:13: in from kda import calculations, diagrams, graph_utils, expressions, ode, svd kda\calculations.py:25: in from sympy import logcombine c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\sympy-1.12-py3.11.egg\sympy\__init__.py:30: in from sympy.core.cache import lazy_function c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\sympy-1.12-py3.11.egg\sympy\core\__init__.py:9: in from .expr import Expr, AtomicExpr, UnevaluatedExpr c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\sympy-1.12-py3.11.egg\sympy\core\expr.py:4159: in from .mul import Mul c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\sympy-1.12-py3.11.egg\sympy\core\mul.py:2193: in from .numbers import Rational c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\sympy-1.12-py3.11.egg\sympy\core\numbers.py:4567: in _sympy_converter[type(mpmath.rational.mpq(1, 2))] = sympify_mpmath_mpq E AttributeError: module 'mpmath' has no attribute 'rational' ============================== warnings summary =============================== ..\..\..\..\..\anaconda3\envs\kda_fresh\lib\site-packages\mpmath-1.4.0a0-py3.11.egg\mpmath\ctx_mp.py:28 c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\mpmath-1.4.0a0-py3.11.egg\mpmath\ctx_mp.py:28: DeprecationWarning: mpnumeric is deprecated warnings.warn(f"{name} is deprecated", DeprecationWarning) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info =========================== ERROR kda/tests/test_kda.py - AttributeError: module 'mpmath' has no attribut... !!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! ========================= 1 warning, 1 error in 4.29s ========================= ```

It appears the tests fail due to an issue with one of SymPy's dependencies (i.e. mpmath) where it is installing a pre-release that is broken (see this issue). From the comments it looks like I could try to downgrade mpmath and re-run the tests, but I think that's bad practice.

There is also the issue regarding 194: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated./PEP 517, I'll have to look into that separately.

Any advice on how to proceed?

orbeckst commented 8 months ago

You can exclude certain versions in your dependencies or just state compatibility with <= known good version. That’s much better than breaking and safer because at least you know it works. Am 3/7/24 um 22:18 schrieb Nik Awtrey @.***>: Started working on this again, and I ran into an issue when running the tests locally. Here is the procedure I was following:

KDA PyPi Test/Upload Procedure

Loosely follow GromacsWraper instructions

Link: https://github.com/Becksteinlab/GromacsWrapper/wiki/Preparing-a-release

create a fresh conda env

conda create --name kda_fresh python=3.11 conda activate kda_fresh

install pip, twine

python -m pip install -U pip twine

clone the repo in a local directory

git clone @.***:Becksteinlab/kda.git

install KDA and run the tests

cd kda python setup.py install python setup.py test

Here is the test output:

Test output $ python setup.py test C:\Users\nikol\Anaconda3\envs\kda_fresh\Lib\site-packages\setuptools__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !!

    ********************************************************************************
    Requirements should be satisfied by a PEP 517 installer.
    If you are using pip, you can try `pip install --use-pep517`.
    ********************************************************************************

!! dist.fetch_build_eggs(dist.setup_requires) C:\Users\nikol\Anaconda3\envs\kda_fresh\Lib\site-packages\setuptools\dist.py:314: InformationOnly: Normalizing 'v0.2.0+4.g533d243' to '0.2.0+4.g533d243' self.metadata.version = self._normalize_version( running pytest C:\Users\nikol\Anaconda3\envs\kda_fresh\Lib\site-packages\setuptools\command\test.py:193: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !!

    ********************************************************************************
    Requirements should be satisfied by a PEP 517 installer.
    If you are using pip, you can try `pip install --use-pep517`.
    ********************************************************************************

!! ir_d = dist.fetch_build_eggs(dist.install_requires) C:\Users\nikol\Anaconda3\envs\kda_fresh\Lib\site-packages\setuptools\command\test.py:194: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !!

    ********************************************************************************
    Requirements should be satisfied by a PEP 517 installer.
    If you are using pip, you can try `pip install --use-pep517`.
    ********************************************************************************

!! tr_d = dist.fetch_build_eggs(dist.tests_require or []) C:\Users\nikol\Anaconda3\envs\kda_fresh\Lib\site-packages\setuptools\command\test.py:195: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !!

    ********************************************************************************
    Requirements should be satisfied by a PEP 517 installer.
    If you are using pip, you can try `pip install --use-pep517`.
    ********************************************************************************

!! er_d = dist.fetch_build_eggs( running egg_info writing kda.egg-info\PKG-INFO writing dependency_links to kda.egg-info\dependency_links.txt writing requirements to kda.egg-info\requires.txt writing top-level names to kda.egg-info\top_level.txt reading manifest file 'kda.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching 'pycache' found anywhere in distribution warning: no previously-included files matching '*.so' found anywhere in distribution adding license file 'LICENSE' writing manifest file 'kda.egg-info\SOURCES.txt' running build_ext ============================= test session starts ============================= platform win32 -- Python 3.11.8, pytest-8.0.2, pluggy-1.4.0 rootdir: C:\Users\nikol\OneDrive\projects\kinetic_diagram_analysis\packages\kda plugins: cov-4.1.0, xdist-3.5.0, hypothesis-6.98.17 collected 21 items / 1 error

=================================== ERRORS ==================================== _ ERROR collecting kda/tests/test_kda.py __ kda\tests\test_kda.py:13: in from kda import calculations, diagrams, graph_utils, expressions, ode, svd kda\calculations.py:25: in from sympy import logcombine c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\sympy-1.12-py3.11.egg\sympy__init.py:30: in from sympy.core.cache import lazy_function c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\sympy-1.12-py3.11.egg\sympy\core\init__.py:9: in from .expr import Expr, AtomicExpr, UnevaluatedExpr c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\sympy-1.12-py3.11.egg\sympy\core\expr.py:4159: in from .mul import Mul c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\sympy-1.12-py3.11.egg\sympy\core\mul.py:2193: in from .numbers import Rational c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\sympy-1.12-py3.11.egg\sympy\core\numbers.py:4567: in _sympy_converter[type(mpmath.rational.mpq(1, 2))] = sympify_mpmath_mpq E AttributeError: module 'mpmath' has no attribute 'rational' ============================== warnings summary =============================== ..........\anaconda3\envs\kda_fresh\lib\site-packages\mpmath-1.4.0a0-py3.11.egg\mpmath\ctx_mp.py:28 c:\users\nikol\anaconda3\envs\kda_fresh\lib\site-packages\mpmath-1.4.0a0-py3.11.egg\mpmath\ctx_mp.py:28: DeprecationWarning: mpnumeric is deprecated warnings.warn(f"{name} is deprecated", DeprecationWarning)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info =========================== ERROR kda/tests/test_kda.py - AttributeError: module 'mpmath' has no attribut... !!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! ========================= 1 warning, 1 error in 4.29s =========================

It appears the tests fail due to an issue with one of SymPy's dependencies (i.e. mpmath) where it is installing a pre-release that is broken (see this issue). From the comments it looks like I could try to downgrade mpmath and re-run the tests, but I think that's bad practice. There is also the issue regarding 194: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated./PEP 517, I'll have to look into that separately. Any advice on how to proceed?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

nawtrey commented 8 months ago

Uninstalling sympy and mpmath and reinstalling with pip install -U sympy mpmath==1.3 (latest non-pre-release version) allowed the tests to run to completion:

============================= test session starts =============================
platform win32 -- Python 3.11.8, pytest-8.0.2, pluggy-1.4.0
rootdir: C:\Users\nikol\OneDrive\projects\kinetic_diagram_analysis\packages\kda
plugins: cov-4.1.0, xdist-3.5.0, hypothesis-6.98.17
collected 64 items

kda\tests\test_kda.py ...........................................        [ 67%]
kda\tests\test_plotting.py .....................                         [100%]

======================== 64 passed in 79.35s (0:01:19) ========================

I can pin mpmath to v1.3.0 as a temporary solution until the pre-release/sympy issue is sorted out. It looks like the sympy folks are doing the same thing upstream (see issue).

I'll open an issue regarding the pinning of mpmath, and another for unpinning when sympy v1.13 is released. While I'm at it, I'll open another issue regarding the PEP 517 issue.

nawtrey commented 8 months ago

Small update -- using python setup.py install seems to be causing most of these issues. If I use the recommended commands via pip (see link) I don't run into any issues with mpmath, and the tests run just fine using pytest:

$ python -m pytest
============================= test session starts =============================
platform win32 -- Python 3.11.8, pytest-8.1.1, pluggy-1.4.0
rootdir: C:\Users\nikol\OneDrive\projects\kinetic_diagram_analysis\packages\kda
plugins: hypothesis-6.99.0
collected 64 items

kda\tests\test_kda.py ...........................................        [ 67%]
kda\tests\test_plotting.py .....................                         [100%]

======================= 64 passed in 104.10s (0:01:44) ========================
updated procedure ``` # create a fresh conda env conda create -n kda_fresh python=3.11 conda activate kda_fresh # install pip, twine, build, pytest python -m pip install -U pip twine build pytest # clone the repo in a local directory git clone git@github.com:Becksteinlab/kda.git cd kda # install KDA and run the tests # NOTE: these commands are deprecated # See: https://packaging.python.org/en/latest/discussions/setup-py-deprecated/ # it looks like we should do the following instead # NOTE: tests may not run if `hypothesis` is not installed python -m pip install . python -m pip install -U hypothesis pytest ```

I believe this was also the cause of the PEP 517 complaints I was getting. I think as long as the modern commands are working I can just ignore the mpmath issue and move forward with PyPi things.

orbeckst commented 8 months ago

Yes, setup.py install is deprecated anyway. You might be able to just have a pyproject.toml file.Am 3/9/24 um 19:00 schrieb Nik Awtrey @.***>: Small update -- using python setup.py install seems to be causing most of these issues. If I use the recommended commands via pip (see link) I don't run into any issues with mpmath, and the tests run just fine using pytest: $ python -m pytest ============================= test session starts ============================= platform win32 -- Python 3.11.8, pytest-8.1.1, pluggy-1.4.0 rootdir: C:\Users\nikol\OneDrive\projects\kinetic_diagram_analysis\packages\kda plugins: hypothesis-6.99.0 collected 64 items

kda\tests\test_kda.py ........................................... [ 67%] kda\tests\test_plotting.py ..................... [100%]

======================= 64 passed in 104.10s (0:01:44) ========================

updated procedure

create a fresh conda env

conda create -n kda_fresh python=3.11 conda activate kda_fresh

install pip, twine, build, pytest

python -m pip install -U pip twine build pytest

clone the repo in a local directory

git clone @.***:Becksteinlab/kda.git cd kda

install KDA and run the tests

NOTE: these commands are deprecated

See: https://packaging.python.org/en/latest/discussions/setup-py-deprecated/

it looks like we should do the following instead

NOTE: tests may not run if hypothesis is not installed

python -m pip install . python -m pip install -U hypothesis pytest

I believe this was also the cause of the PEP 517 complaints I was getting. I think as long as the modern commands are working I can just ignore the mpmath issue and move forward with PyPi things.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

nawtrey commented 8 months ago

The current version of KDA (v0.3.0) is now available on PyPi here. Closing this issue.

orbeckst commented 8 months ago

Hooray 🍾 !