ukhsa-collaboration / pygom

ODE modelling in Python
GNU General Public License v2.0
27 stars 20 forks source link

Tests not working out the box. #106

Closed JamesABaker closed 3 months ago

JamesABaker commented 1 year ago

Hi there,

I am having a bit of difficulty getting the tests to run.

Steps to reproduce:

  1. git clone https://github.com/ukhsa-collaboration/pygom.git ✔️
  2. cd pygom ✔️
  3. conda env create -f conda-env.yml just hung, ❌
  4. I switched to pip install -r requirements.txt ✔️
  5. python setup.py install 🚩
  6. python setup.py test

Setup raises the following warning:

writing manifest file 'pygom.egg-info\SOURCES.txt'
c:\users\james.baker\documents\pygom\.eggs\setuptools_scm-8.0.3-py3.8.egg\setuptools_scm\_integrat:
ERROR: setuptools==49.2.0.post20200714 is used in combination with setuptools_scm>=8.x

Your build configuration is incomplete and previously worked by accident!
setuptools_scm requires setuptools>=61

Suggested workaround if applicable:
 - migrating from the deprecated setup_requires mechanism to pep517/518
   and using a pyproject.toml to declare build dependencies
   which are reliably pre-installed before running the build tools

  warnings.warn(
WARNING setuptools_scm._file_finders.git toplevel mismatch computed c:\users\james.baker\documentsker\Documents\pygom
reading manifest template 'MANIFEST.in'
warning: no files found matching 'data\*.json'
writing manifest file 'pygom.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\pygom
copying pygom\__init__.py -> build\lib.win-amd64-3.8\pygom
creating build\lib.win-amd64-3.8\pygom\model
copying pygom\model\base_ode_model.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\common_models.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\deterministic.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\epi_analysis.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\ode_variable.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\simulate.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\stochastic_simulation.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\transition.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\_model_errors.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\_model_verification.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\_ode_composition.py -> build\lib.win-amd64-3.8\pygom\model
copying pygom\model\__init__.py -> build\lib.win-amd64-3.8\pygom\model
creating build\lib.win-amd64-3.8\pygom\model\ode_utils
copying pygom\model\ode_utils\checks_and_conversions.py -> build\lib.win-amd64-3.8\pygom\model\ode
copying pygom\model\ode_utils\compile_canary.py -> build\lib.win-amd64-3.8\pygom\model\ode_utils
copying pygom\model\ode_utils\plot_det.py -> build\lib.win-amd64-3.8\pygom\model\ode_utils
copying pygom\model\ode_utils\plot_stoc.py -> build\lib.win-amd64-3.8\pygom\model\ode_utils
copying pygom\model\ode_utils\__init__.py -> build\lib.win-amd64-3.8\pygom\model\ode_utils
creating build\lib.win-amd64-3.8\pygom\loss
copying pygom\loss\base_loss.py -> build\lib.win-amd64-3.8\pygom\loss
copying pygom\loss\confidence_interval.py -> build\lib.win-amd64-3.8\pygom\loss
copying pygom\loss\epijson_loss.py -> build\lib.win-amd64-3.8\pygom\loss
copying pygom\loss\get_init.py -> build\lib.win-amd64-3.8\pygom\loss
copying pygom\loss\loss_type.py -> build\lib.win-amd64-3.8\pygom\loss
copying pygom\loss\ode_loss.py -> build\lib.win-amd64-3.8\pygom\loss
copying pygom\loss\read_epijson.py -> build\lib.win-amd64-3.8\pygom\loss
copying pygom\loss\__init__.py -> build\lib.win-amd64-3.8\pygom\loss
creating build\lib.win-amd64-3.8\pygom\utilR
copying pygom\utilR\distn.py -> build\lib.win-amd64-3.8\pygom\utilR
copying pygom\utilR\__init__.py -> build\lib.win-amd64-3.8\pygom\utilR
copying pygom\model\_tau_leap.pyx -> build\lib.win-amd64-3.8\pygom\model
creating build\lib.win-amd64-3.8\pygom\approximate_bayesian_computation
copying pygom\approximate_bayesian_computation\__init__.py -> build\lib.win-amd64-3.8\pygom\approx
copying pygom\approximate_bayesian_computation\approximate_bayesian_computation.py -> build\lib.wian_computation
creating build\lib.win-amd64-3.8\pygom\data
copying pygom\data\eg1.json -> build\lib.win-amd64-3.8\pygom\data
copying pygom\model\_tau_leap.c -> build\lib.win-amd64-3.8\pygom\model
copying pygom\loss\.gitignore -> build\lib.win-amd64-3.8\pygom\loss
running build_ext
skipping 'pygom/model\_tau_leap.c' Cython extension (up-to-date)
building 'pygom.model._tau_leap' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https:/s/

The test yields the following error:

c:\users\james.baker\documents\pygom\.eggs\setuptools_scm-8.0.3-py3.8.egg\setuptools_scm\_integrat:
ERROR: setuptools==49.2.0.post20200714 is used in combination with setuptools_scm>=8.x

Your build configuration is incomplete and previously worked by accident!
setuptools_scm requires setuptools>=61

Suggested workaround if applicable:
 - migrating from the deprecated setup_requires mechanism to pep517/518
   and using a pyproject.toml to declare build dependencies
   which are reliably pre-installed before running the build tools

  warnings.warn(
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looindependent of test runner are encouraged to use tox.

Traceback (most recent call last):
  File "setup.py", line 80, in <module>
    setup(
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 165, in setup
    return distutils.core.setup(**attrs)
  File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\test.py", line 226, in run
    installed_dists = self.install_dists(self.distribution)
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\test.py", line 209, in insta
    ir_d = dist.fetch_build_eggs(dist.install_requires)
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 699, in fetch_build_e
    resolved_dists = pkg_resources.working_set.resolve(
  File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 790, in resolv
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (sphinx 5.3.0 (c:\users\james.baker\documents\pygom\.eggst.parse('sphinx<5.1,>=4'), {'sphinx-jupyterbook-latex'})

Alternatively, running pytest yields:

!!!!!!!!!!!!!!!!!! Interrupted: 17 errors during collection !!!!!!!!!!!!!!!!!!!
======================= 1 warning, 17 errors in 18.62s ========================

Please let me know if this should be working, or if there is a different way of running the tests that I should try.

Thanks 😄


system info: $ python --version Python 3.8.3

OS: Microsoft Windows 10 Enterprise

let me know if any more info would be helpful.

twomagpi commented 3 months ago

Tests on Windows will need Visual C++ Build Tools if you are building from source.

We now supply wheels for Windows via PyPI (so you should be able to use these pre-built versions), and have updated the documentation http://ukhsa-collaboration.github.io/pygom/md/getting_started.html to make this more clear.

Thank you for reporting the issue.