severb / graypy

Python logging handler for Graylog that sends messages in GELF (Graylog Extended Log Format).
https://www.graylog.org/
BSD 3-Clause "New" or "Revised" License
258 stars 90 forks source link

Installation polutes the site-packages with tests blocking imports from local directory tests #131

Open quati opened 3 years ago

quati commented 3 years ago

Hi!

When graypy 2.1.0 is installed it creates (copies) the tests directory to the site-packages directly. This makes impossible to import local directory tests if it's present.

I have a project with following structure:

- my_application      # Application's code
- tests               # PyTest unittests
    - conftest.py     # tests setup and some helper functions
    - ...
- features            # Behave tests, etc. 
    - environment.py  
    - ...

When in environment.py I want to import some tools from tests/conftest.py (to reuse some code between tests) and call

from tests.conftest import foo

I get an ImportError because by default site-packages/tests is imported.

Only "universal" workaround I found is to delete the tests directory in site-packages.

However it would be nice to not place it there in the first-place and either install the tests dir in site-packages/graypy/tests or not at all.