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

None of those Python files was found in the root dir: setup.py, autoapp.py #72

Closed
sobolevn opened this issue Aug 12, 2019 · 5 comments
Closed
Labels
bug Something isn't working released Feature/fix is released

Comments

@sobolevn
Copy link

sobolevn commented Aug 12, 2019

Current Behavior

  1:1      NIP102 None of those Python files was found in the root dir /home/travis/build/wemake-services/wemake-python-styleguide/docs: setup.py, autoapp.py
  # -*- coding: utf-8 -*-
  ^

Source: wemake-services/wemake-python-styleguide#760
CI: https://travis-ci.org/wemake-services/wemake-python-styleguide/jobs/571009091

I am not sure what's going on.
It also does not happen locally.

@sobolevn sobolevn added the bug Something isn't working label Aug 12, 2019
@andreoliwa
Copy link
Owner

Hi @sobolevn.

This is related to the search for the root dir of the project.
This is my guess: your project has a root dir (the one with pyproject.toml or setup.cfg), but no Python files could be found.

I have a hardcoded list of files that usually belong to the root: app.py, setup.py, manage.py, or any *.py file.
The error message is slightly wrong, though; it should say something about manage.py and *.py.

Anyway, I'm not sure how to determine the root folder of a project.
There was another issue with a Django project before (#21).

I am also assuming that every project must have at least one .*py file, otherwise flake8 won't even work.

Could you share your directory tree like this?
Then I could try to understand what's going on.
Thanks!

.
├── AUTHORS.rst
├── CHANGELOG.md
├── CONTRIBUTING.rst
├── LICENSE
├── Makefile
├── MANIFEST.in
├── nitpick-style.toml
├── package.json
├── poetry.lock
├── pyproject.toml
├── README.md
├── setup.cfg
├── src
│  └── nitpick
│     ├── __init__.py
│     ├── config.py
│     ├── constants.py
│     ├── exceptions.py
│     ├── files
│     │  ├── __init__.py
│     │  ├── base.py
│     │  ├── json.py
│     │  ├── pre_commit.py
│     │  ├── pyproject_toml.py
│     │  └── setup_cfg.py
│     ├── formats.py
│     ├── generic.py
│     ├── mixin.py
│     ├── plugin.py
│     ├── schemas.py
│     ├── style.py
│     ├── typedefs.py
│     └── validators.py
└── tests
   ├── __init__.py
   ├── conftest.py
   ├── fixtures
   │  └── hello.py
   ├── helpers.py
   ├── test_config.py
   ├── test_generic.py
   ├── test_json.py
   ├── test_plugin.py
   ├── test_pre_commit.py
   ├── test_pyproject_toml.py
   ├── test_setup_cfg.py
   └── test_style.py

@andreoliwa
Copy link
Owner

I think I know the problem.
There is a requirements.txt file inside the docs subdirectory, and nitpick incorrectly thinks this is the root dir of the project.

andreoliwa pushed a commit that referenced this issue Aug 13, 2019
# [0.19.0](v0.18.0...v0.19.0) (2019-08-13)

### Bug Fixes

* emit warning when TOML is invalid in a style file (closes [#68](#68)) ([b48e0a4](b48e0a4))
* files should not be deleted unless explicitly set in the style ([b5953ff](b5953ff)), closes [#71](#71)
* improve the way to find the root dir of the project ([fa3460a](fa3460a)), closes [#72](#72)

### Features

* validate the merged style file schema ([1e31d0a](1e31d0a)), closes [#69](#69)
@andreoliwa
Copy link
Owner

🎉 This issue has been resolved in version 0.19.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@andreoliwa andreoliwa added the released Feature/fix is released label Aug 13, 2019
@sobolevn
Copy link
Author

Just to be clear: we can always have a configuration option for the complex cases.

@andreoliwa
Copy link
Owner

Yes. 👍 If it happens again, I will think of some configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Feature/fix is released
Projects
None yet
Development

No branches or pull requests

2 participants