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

LocalPath' object has no attribute 'expandtabs' when using tox-conda #167

Open
not-a-feature opened this issue Apr 19, 2023 · 0 comments
Open

Comments

@not-a-feature
Copy link

Hey,

Tox / Tox-conda crashes with an ambiguous error.

I have a python package with a lot of requirements from conda-forge and bioconda.
Whenever i run tox -e py37 i get a

  File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/pyparsing/core.py", line 1129, in parse_string
    instring = instring.expandtabs()
AttributeError: 'LocalPath' object has no attribute 'expandtabs'

The complete stacktrace is here:

Stacktrace ``` (g2p-test) jules@framework:~/path/to/package/$ tox -e py37 .package create: /path/to/package/.tox/.package .package installdeps: setuptools, wheel Traceback (most recent call last): File "/home/jules/miniconda3/envs/g2p-test/bin/tox", line 10, in sys.exit(cmdline()) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/tox/session/__init__.py", line 44, in cmdline main(args) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/tox/session/__init__.py", line 69, in main exit_code = session.runcommand() File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/tox/session/__init__.py", line 197, in runcommand return self.subcommand_test() File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/tox/session/__init__.py", line 213, in subcommand_test venv.package = self.hook.tox_package(session=self, venv=venv) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/pluggy/_hooks.py", line 265, in __call__ return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/pluggy/_manager.py", line 80, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/pluggy/_callers.py", line 60, in _multicall return outcome.get_result() File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/pluggy/_result.py", line 60, in get_result raise ex[1].with_traceback(ex[2]) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/pluggy/_callers.py", line 39, in _multicall res = hook_impl.function(*args) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/tox/package/__init__.py", line 16, in tox_package session.package, session.dist = get_package(session) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/tox/package/__init__.py", line 29, in get_package package = acquire_package(config, session) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/tox/package/__init__.py", line 40, in acquire_package path = build_package(config, session) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/tox/package/builder/__init__.py", line 9, in build_package return build(config, session) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/tox/package/builder/isolated.py", line 40, in build canonicalize_name(Requirement(r.name).name) for r in package_venv.envconfig.deps File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/tox/package/builder/isolated.py", line 40, in canonicalize_name(Requirement(r.name).name) for r in package_venv.envconfig.deps File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/packaging/requirements.py", line 102, in __init__ req = REQUIREMENT.parseString(requirement_string) File "/home/jules/miniconda3/envs/g2p-test/lib/python3.7/site-packages/pyparsing/core.py", line 1129, in parse_string instring = instring.expandtabs() AttributeError: 'LocalPath' object has no attribute 'expandtabs' ```

I have following tox.ini configuration:

[tox]
envlist = py37, flake8, mypy
isolated_build = True
requires = tox-conda


[testenv]
description = Invoke pytest to run automated tests.
setenv =
    TOXINIDIR = {toxinidir}
conda_env =
    {toxinidir}/tests/g2p-test.yaml
passenv =
    HOME
    SETUPTOOLS_*
extras =
    testing
commands =
    python -m pytest {posargs}

And my environment (and the one i want to use with tox-conda) is here:

name: g2p-test
channels:
  - conda-forge
  - bioconda
  - defaults
dependencies:
  - bwa=0.7.17
  - gatk=3.8
  - imbalanced-learn=0.8.1
  - joblib=1.1.1
  - mtbseq=1.0.4
  - numpy=1.21.5
  - numpy-base=1.21.5
  - packaging=21.3
  - pandas=0.25.3
  - perl-base=2.23
  - python=3.7.12
  - pytest=7.2
  - requests=2.28
  - samtools=1.6
  - scikit-learn=0.24.2
  - scipy=1.7.3
  - setuptools=65.5.0
  - tox=3
  - tox-conda=0.10
  - tqdm=4.64
  - importlib_metadata

As i'm now struggeling for several weeks i decided to ask if somebody has any idea.
Thanks a lot,
~Jules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant