Git Hooks inside PyCharm running in incorrect environment

I have recently started a new project in PyCharm, finally utilizing anaconda environments. However, after trying to make my first commit through PyCharm, it appears to be using my native python,...

tox multiple tests, re-using tox environment

Is it possible to do the following using a single tox virtual environment? [tox] envlist = test, pylint, flake8, mypy skipsdist = true [testenv:lint] deps = pylint commands = pylint...

Can't install dependencies in docker container

I'm using poetry library to manage project dependencies, so when I use docker build --tag=helloworld . I got this error [AttributeError] 'NoneType' object has no attribute 'group' ...

Tox 0% coverage

I have a python project where I use: pipenv tox pytest and many more. Basically, I want to add tox to my gitlab pipelines. And almost everything seems to work, calling mypy, flake8 or black from...

Cannot install pytorch in a virtualenv on windows

I know there are a few topics about that on this website but still, I can't find the solution. So here is what I did : I created a projecton Visual Studio 19 for python. I added an virtual...

How can I get tox and poetry to work together to support testing multiple versions of a Python dependency?

I am switching a project that currently uses pipenv to poetry as a test to see what the differences are. The project is a simple, redistributable, Django app. It supports Python 3.6-8, and Django...

Gitlab-CI for Python project with SonarQube

I want to set Gitlab-CI for my python project with SonarQube. I have one problem with that. I set SonarQube variables in settings gitlab-ci. This is my gitlab-ci.yml file: variables: ...

How can I mock ECS with moto?

I want to create a mock ECS cluster, but it seems not to work properly. Although something is mocked (I don't get a credentials error), it seems not to "save" the cluster. How can I create a mock...

With azure pipelines and poetry, is there any way to avoid sourcing ~/.poetry/env in every script?

I currently use the script below to build my package and publish it to a private Azure Artifacts feed. In every script, I have to run the line source $HOME/.poetry/env or it cannot find the poetry...

Why don't SQLAlchemy show up in the search results of `pip3 search SQLAlchemy`?

I wanted to install SQLAlchemy for Python 3 for working with databases. I searched for the package using pip3 search SQLAlchemy, but I didn't find SQLAlchemy as part of the results. Why don't...

Typechecking dynamically added attributes

When writing project-specific pytest plugins, I often find the Config object useful to attach my own properties. Example: from _pytest.config import Config def pytest_configure(config: Config)...

Debuging Multiple Python Azure-Functions locally in VS Code

I followed this Microsoft tutorial using CLI to create Azure-Function in python. I then created a second function, both HttpTriggered. C:\Users\rnwol\workspace\anotherazfunc ├──...

cannot import name 'UnpickleError' from rq.exceptions

I get an error when i run my image with docker-compose this is my pipfile with the library rq i try to up the image but i get an error in django-rq, but i not change this library i only add in my...

ModuleNotFoundError: No module named 'flake8'

here is the part of the files that are important for this question: . ├── .env ├── tox.ini ├── requirements-dev.txt └── tests/ ├── test_blocking.py └──...

Requirement for __init__.py just to satisfy pylint and mypy

I have a project with the following (partial) directory structure . ├── mypy.ini ├── src │ ├── preppy │ │ ├── cli.py │ │ ├── __main__.py │ │...

Conda environment : several environment files - specify cpu-only version of Pytorch

I am using conda 4.8.3 with Python 3.7, I am writing environment files to specify the dependencies of my project. I would like to write several files to be able to install several...

pyproject.toml not found when using Poetry in Tox' parallel execution

I tried to switch a Python package of mine from setuptools to Poetry. Since I use Tox to orchestrate my test suite (with linters), I had to adapt my tox.ini as well. A minimal configuration of Tox...

Can I combine mypy reports with pytest coverage reports?

I can generate a type "coverage" report with mypy via mypy . --html-report mypy-report and a pytest coverage report with pytest-cov pytest --cov=app --cov-report=html Is there a way to combine...

How to specify mypy types for pytest fixtures

I am trying to specify mypy type hints for the pytest native fixtures I am using in my test project e.g.: import pytest def pytest_configure(config): # Do something useful here The config...

Why is mypy finding "no type hints or library stubs" for any of my imports?

I'm working on a code base that has a lot of type hints written be a previous developer. At some point I noticed that these hints were not getting type-checked, and that I needed to add a step to...

How to make work typing annotation on mypy with unpacking params for pytest parameterized test?

I have a simple method on my_module.py with the signature: def my_method(value: float, extra: str = "something") -> str: pass Then I have a parameterized test on test_my_module.py for...

Using poetry on different machines

I am working on a Python project and recently started using poetry. I was originally working on the project using macOS 11.0, but as I near completion, I wanted to test it on a Linux workstation....

zsh (mac big sur) Can't Recognize pip install

I recently started using zsh with oh-my-zch. I then ran into trouble of not able to do simply pip install command. I checked the version: it shows 2.7.16 for 'python --version' and '3.8.2' for...

NameError: name '_mysql' is not defined -- On airflow start in MacOSX

There are numbers of articles on the titled question but none of them worked for me. The detailed error is as follows: Traceback (most recent call last): File...

Python3 Import Error: undefined symbol: aes_hw_encrypt

I am trying to use DialogFlow to make a small talk chatbot on Raspberry Pi 4, and I am getting this error: ImportError:...

BROWNIE - installation issue

I am trying to install Brownie and get the following error " PS C:\Python39> pip install eth-brownie Collecting eth-brownie Using cached eth_brownie-1.14.6-py3-none-any.whl (207 kB) ...

poetry install | SolverProblemError Because my_project depends on string (*) which doesn't match any versions, version solving failed

I am yet to use poetry to run project, so excuse lack of understanding. I successfully installed the poetry python library manager, using: curl -sSL...

What is the type hint for Pytest's "caplog" fixture?

As the title says. I am using the caplog fixture that comes with pytest. I am using mypy for my type checking, and would like to know what the correct type hint for caplog is. For example: def...

MyPy Cannot Find Library Stubs for Specific Python Version

I'm following the tutorial on type checking with mypy here. When I run a nox session to run mypy against the code, the Python 3.7 check complains about mypy not being able to find stubs for some...

PIP failed to build package cytoolz

I'm trying to install eth-brownie using 'pipx install eth-brownie' but I get an error saying pip failed to build package: cytoolz Some possibly relevant errors from pip install: ...