question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`tox` warning when running default configuration

See original GitHub issue

Hello,

I am testing this as a potential way to structure a project I’m working on. First of all - awesome job.

I’ve set up my repository and made a few changes to the environment files and so on and I tested to see that tox works with some dummy test file and dummy test function before adding my code to the repository. When I run the command tox, the test passes but I get the following warning:

image

The way I understand this is that the extras field under [testenv] basically means that tox executes pip install[testing] since extras is bound to testing and there is an entry in the setup.cfg to install the dependencies. Hence, I don’t understand exactly what tox complains about? Should I go and explicitly add deps to [testenv] ?

Many thanks for great work, it’s a massive help!

Relevant testenv config.

[testenv]
description = invoke pytest to run automated tests
isolated_build = True
setenv =
    TOXINIDIR = {toxinidir}
passenv =
    HOME
extras =
    testing
commands =
    pytest {posargs}

Relevant part of setup.cfg

[options.extras_require]
# Add here additional requirements for extra features, to install with:
# `pip install sgd-utils[PDF]` like:
# PDF = ReportLab; RXP

# Add here test requirements (semicolon/line-separated)
testing =
    setuptools
    pytest>=6.2.3, <7.0.0
    pytest-cov

Please provide any additional information below. I created my environment using the command:

conda env create -f environment.yml

where the environment file is

name: my_package_name
channels:
  - defaults
  - conda-forge
  - pytorch
  # - fastai
dependencies:
  - python>=3.8, <3.9
  - pip
  # BASICS
  # VISUALIZATION
  - matplotlib
  - seaborn
  # OTHER TOOLS
  - pip:
     - -e .  # install git checkout of sgd-utils in editable mode
     # add here only pip-packages that are not available in conda/conda-forge!
     # or use if your preferred way of installing packages is pip in a conda env :)

and then updating with

conda env update -f dev_environment.yml

where the dev_environment.yml file is

name: my_package_name
channels:
  - defaults
  - conda-forge
  - pytorch
dependencies:
  - pip:
    #   - jupyterlab
    - pytest>=6.2.3, <7.0.0
    - pytest-cov
    - tox
    - pre_commit
    - nbdime
    #- nbstripout
    - sphinx
    - recommonmark
    - flake8>=3.9.1, <4.0.0

Versions and main components

  • PyScaffold Version: 4.0.1
  • dsproject extension: 0.6.1
  • Python Version: 3.8.8
  • Operating system: Windows 10 (but working in WSL 1)
  • How did you install PyScaffold: pip

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexcocacommented, Jun 29, 2021

@FlorianWilhelm, I have followed your advice and put the development dependencies under -dependencies rather than -pip. tox now runs warning free 👍! Thank you so much for your help and sorry for the delay.

Your work is very valuable for machine learning research.

1reaction
FlorianWilhelmcommented, May 16, 2021

Hi @alexcoca, any news on this issue? Have you had time to test it out again?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration - tox
A list of environments to run by default (when the user does not specify anything during the invocation). Changed in version 3.4.0: Which...
Read more >
avoid spurious warning about basepython setting for default ...
I just wrote a dirty little script that grabs a bunch of tox.ini files from github and and runs parseconfig over them.
Read more >
Linting Python in Visual Studio Code
It's common with Prospector to use profiles to configure how Prospector runs. By default, Prospector loads the profile from a .prospector.yaml file in...
Read more >
Configuration — pytest documentation
tox.ini files are the configuration files of the tox project, and can also be ... pytest determines a rootdir for each test run...
Read more >
tox Documentation - Read the Docs
you want your project to run in into a tox.ini file residing right ... This configuration will install docutils from the default Python...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found