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

Fix working dir detection #282

Merged

Conversation

chocoelho
Copy link
Contributor

See: #257 (comment)

@carlio how do you feel about it?

Signed-off-by: Carlos Coêlho <carlos@vinta.com.br>
Signed-off-by: Carlos Coêlho <carlos@vinta.com.br>
Signed-off-by: Carlos Coêlho <carlos@vinta.com.br>
@chocoelho chocoelho requested a review from carlio October 5, 2018 17:26
@chocoelho
Copy link
Contributor Author

Tests are broken but first wanna check the idea of considering the rootpath into the minimal path method.

@coveralls
Copy link

coveralls commented Oct 5, 2018

Pull Request Test Coverage Report for Build 643

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 296 unchanged lines in 19 files lost coverage.
  • Overall coverage remained the same at 77.638%

Files with Coverage Reduction New Missed Lines %
prospector/formatters/text.py 1 64.29%
prospector/encoding.py 5 66.67%
prospector/finder.py 6 83.59%
prospector/tools/pylint/linter.py 7 64.71%
prospector/message.py 8 79.66%
prospector/tools/pylint/collector.py 10 86.21%
prospector/tools/pep257/init.py 10 80.65%
prospector/tools/pylint/indent_checker.py 11 80.77%
prospector/formatters/grouped.py 12 100.0%
prospector/config/init.py 12 80.65%
Totals Coverage Status
Change from base Build 639: 0.0%
Covered Lines: 1538
Relevant Lines: 1981

💛 - Coveralls

@@ -134,7 +134,7 @@ def get_minimal_syspath(self, absolute_paths=True):
if dirname not in packages:
module_list.append(dirname)

full_list = sorted(set(module_list) | package_list, key=len)
full_list = sorted(set(module_list) | package_list | {self.rootpath}, key=len)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the module_list should already include python files from cwd but I'm not sure about that. I'll have a play around tomorrow to see why that isn't already happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any news on that @carlio ?

Signed-off-by: Carlos Coêlho <carlos@vinta.com.br>
@chocoelho chocoelho merged commit 94a8475 into prospector-dev:develop Nov 17, 2018
guykisel pushed a commit to guykisel/inline-plz that referenced this pull request Jan 9, 2019



### Update [wheel](https://pypi.org/project/wheel) from **0.32.2** to **0.32.3**.


<details>
  <summary>Changelog</summary>
  
  
   ### 0.32.3
   ```
   - Fixed compatibility with Python 2.7.0 – 2.7.3
- Fixed handling of direct URL requirements with markers (PR by Benoit Pierre)
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/wheel
  - Changelog: https://pyup.io/changelogs/wheel/
  - Repo: https://github.com/pypa/wheel
</details>





### Update [tox](https://pypi.org/project/tox) from **3.5.3** to **3.6.1**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/tox
  - Docs: https://tox.readthedocs.org/
</details>





### Update [coverage](https://pypi.org/project/coverage) from **4.5.1** to **4.5.2**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/coverage
  - Changelog: https://pyup.io/changelogs/coverage/
  - Repo: https://bitbucket.org/ned/coveragepy
</details>





### Update [Sphinx](https://pypi.org/project/Sphinx) from **1.8.1** to **1.8.3**.


<details>
  <summary>Changelog</summary>
  
  
   ### 1.8.3
   ```
   ==============================

Dependencies
------------

Incompatible changes
--------------------

Deprecated
----------

Features added
--------------

* LaTeX: it is possible to insert custom material to appear on back of title
  page, see discussion of ``&#39;maketitle&#39;`` key of :confval:`latex_elements`
  (``&#39;manual&#39;`` docclass only)

Bugs fixed
----------

* 5725: mathjax: Use CDN URL for &quot;latest&quot; version by default
* 5460: html search does not work with some 3rd party themes
* 5520: LaTeX, caption package incompatibility since Sphinx 1.6
* 5614: autodoc: incremental build is broken when builtin modules are imported
* 5627: qthelp: index.html missing in QtHelp
* 5659: linkcheck: crashes for a hyperlink containing multibyte character
* 5754: DOC: Fix some mistakes in :doc:`/latex`
* 5810: LaTeX: sphinxVerbatim requires explicit &quot;hllines&quot; set-up since 1.6.6
  (refs: 1238)
* 5636: C++, fix parsing of floating point literals.
* 5496 (again): C++, fix assertion in partial builds with duplicates.
* 5724: quickstart: sphinx-quickstart fails when $LC_ALL is empty
* 1956: Default conf.py is not PEP8-compliant
* 5849: LaTeX: document class ``\maketitle`` is overwritten with no
  possibility to use original meaning in place of Sphinx custom one
* 5834: apidoc: wrong help for ``--tocfile``
* 5800: todo: crashed if todo is defined in TextElement
* 5846: htmlhelp: convert hex escaping to decimal escaping in .hhc/.hhk files

Testing
--------
   ```
   
  
  
   ### 1.8.2
   ```
   =====================================

Incompatible changes
--------------------

* 5497: Do not include MathJax.js and jsmath.js unless it is really needed

Features added
--------------

* 5471: Show appropriate deprecation warnings

Bugs fixed
----------

* 5490: latex: enumerated list causes a crash with recommonmark
* 5492: sphinx-build fails to build docs w/ Python &lt; 3.5.2
* 3704: latex: wrong ``\label`` positioning for figures with a legend
* 5496: C++, fix assertion when a symbol is declared more than twice.
* 5493: gettext: crashed with broken template
* 5495: csv-table directive with file option in included file is broken (refs:
  4821)
* 5498: autodoc: unable to find type hints for a ``functools.partial``
* 5480: autodoc: unable to find type hints for unresolvable Forward references
* 5419: incompatible math_block node has been generated
* 5548: Fix ensuredir() in case of pre-existing file
* 5549: graphviz Correctly deal with non-existing static dir
* 3002: i18n: multiple footnote_references referring same footnote causes
  duplicated node_ids
* 5563: latex: footnote_references generated by extension causes LaTeX builder
  crashed
* 5561: make all-pdf fails with old xindy version
* 5557: quickstart: --no-batchfile isn&#39;t honored
* 3080: texinfo: multiline rubrics are broken
* 3080: texinfo: multiline citations are broken
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/sphinx
  - Changelog: https://pyup.io/changelogs/sphinx/
  - Homepage: http://sphinx-doc.org/
</details>





### Update [pytest](https://pypi.org/project/pytest) from **3.9.3** to **4.0.2**.


<details>
  <summary>Changelog</summary>
  
  
   ### 4.0.2
   ```
   =========================

Bug Fixes
---------

- `4265 &lt;https://github.com/pytest-dev/pytest/issues/4265&gt;`_: Validate arguments from the ``PYTEST_ADDOPTS`` environment variable and the ``addopts`` ini option separately.


- `4435 &lt;https://github.com/pytest-dev/pytest/issues/4435&gt;`_: Fix ``raises(..., &#39;code(string)&#39;)`` frame filename.


- `4500 &lt;https://github.com/pytest-dev/pytest/issues/4500&gt;`_: When a fixture yields and a log call is made after the test runs, and, if the test is interrupted, capture attributes are ``None``.


- `4538 &lt;https://github.com/pytest-dev/pytest/issues/4538&gt;`_: Raise ``TypeError`` for ``with raises(..., match=&lt;non-None falsey value&gt;)``.



Improved Documentation
----------------------

- `1495 &lt;https://github.com/pytest-dev/pytest/issues/1495&gt;`_: Document common doctest fixture directory tree structure pitfalls
   ```
   
  
  
   ### 4.0.1
   ```
   =========================

Bug Fixes
---------

- `3952 &lt;https://github.com/pytest-dev/pytest/issues/3952&gt;`_: Display warnings before &quot;short test summary info&quot; again, but still later warnings in the end.


- `4386 &lt;https://github.com/pytest-dev/pytest/issues/4386&gt;`_: Handle uninitialized exceptioninfo in repr/str.


- `4393 &lt;https://github.com/pytest-dev/pytest/issues/4393&gt;`_: Do not create ``.gitignore``/``README.md`` files in existing cache directories.


- `4400 &lt;https://github.com/pytest-dev/pytest/issues/4400&gt;`_: Rearrange warning handling for the yield test errors so the opt-out in 4.0.x correctly works.


- `4405 &lt;https://github.com/pytest-dev/pytest/issues/4405&gt;`_: Fix collection of testpaths with ``--pyargs``.


- `4412 &lt;https://github.com/pytest-dev/pytest/issues/4412&gt;`_: Fix assertion rewriting involving ``Starred`` + side-effects.


- `4425 &lt;https://github.com/pytest-dev/pytest/issues/4425&gt;`_: Ensure we resolve the absolute path when the given ``--basetemp`` is a relative path.



Trivial/Internal Changes
------------------------

- `4315 &lt;https://github.com/pytest-dev/pytest/issues/4315&gt;`_: Use ``pkg_resources.parse_version`` instead of ``LooseVersion`` in minversion check.


- `4440 &lt;https://github.com/pytest-dev/pytest/issues/4440&gt;`_: Adjust the stack level of some internal pytest warnings.
   ```
   
  
  
   ### 4.0.0
   ```
   =========================

Removals
--------

- `3737 &lt;https://github.com/pytest-dev/pytest/issues/3737&gt;`_: **RemovedInPytest4Warnings are now errors by default.**

  Following our plan to remove deprecated features with as little disruption as
  possible, all warnings of type ``RemovedInPytest4Warnings`` now generate errors
  instead of warning messages.

  **The affected features will be effectively removed in pytest 4.1**, so please consult the
  `Deprecations and Removals &lt;https://docs.pytest.org/en/latest/deprecations.html&gt;`__
  section in the docs for directions on how to update existing code.

  In the pytest ``4.0.X`` series, it is possible to change the errors back into warnings as a stop
  gap measure by adding this to your ``pytest.ini`` file:

  .. code-block:: ini

      [pytest]
      filterwarnings =
          ignore::pytest.RemovedInPytest4Warning

  But this will stop working when pytest ``4.1`` is released.

  **If you have concerns** about the removal of a specific feature, please add a
  comment to `4348 &lt;https://github.com/pytest-dev/pytest/issues/4348&gt;`__.


- `4358 &lt;https://github.com/pytest-dev/pytest/issues/4358&gt;`_: Remove the ``::()`` notation to denote a test class instance in node ids.

  Previously, node ids that contain test instances would use ``::()`` to denote the instance like this::

      test_foo.py::Test::()::test_bar

  The extra ``::()`` was puzzling to most users and has been removed, so that the test id becomes now::

      test_foo.py::Test::test_bar

  This change could not accompany a deprecation period as is usual when user-facing functionality changes because
  it was not really possible to detect when the functionality was being used explicitly.

  The extra ``::()`` might have been removed in some places internally already,
  which then led to confusion in places where it was expected, e.g. with
  ``--deselect`` (`4127 &lt;https://github.com/pytest-dev/pytest/issues/4127&gt;`_).

  Test class instances are also not listed with ``--collect-only`` anymore.



Features
--------

- `4270 &lt;https://github.com/pytest-dev/pytest/issues/4270&gt;`_: The ``cache_dir`` option uses ``$TOX_ENV_DIR`` as prefix (if set in the environment).

  This uses a different cache per tox environment by default.



Bug Fixes
---------

- `3554 &lt;https://github.com/pytest-dev/pytest/issues/3554&gt;`_: Fix ``CallInfo.__repr__`` for when the call is not finished yet.
   ```
   
  
  
   ### 3.10.1
   ```
   ==========================

Bug Fixes
---------

- `4287 &lt;https://github.com/pytest-dev/pytest/issues/4287&gt;`_: Fix nested usage of debugging plugin (pdb), e.g. with pytester&#39;s ``testdir.runpytest``.


- `4304 &lt;https://github.com/pytest-dev/pytest/issues/4304&gt;`_: Block the ``stepwise`` plugin if ``cacheprovider`` is also blocked, as one depends on the other.


- `4306 &lt;https://github.com/pytest-dev/pytest/issues/4306&gt;`_: Parse ``minversion`` as an actual version and not as dot-separated strings.


- `4310 &lt;https://github.com/pytest-dev/pytest/issues/4310&gt;`_: Fix duplicate collection due to multiple args matching the same packages.


- `4321 &lt;https://github.com/pytest-dev/pytest/issues/4321&gt;`_: Fix ``item.nodeid`` with resolved symlinks.


- `4325 &lt;https://github.com/pytest-dev/pytest/issues/4325&gt;`_: Fix collection of direct symlinked files, where the target does not match ``python_files``.


- `4329 &lt;https://github.com/pytest-dev/pytest/issues/4329&gt;`_: Fix TypeError in report_collect with _collect_report_last_write.



Trivial/Internal Changes
------------------------

- `4305 &lt;https://github.com/pytest-dev/pytest/issues/4305&gt;`_: Replace byte/unicode helpers in test_capture with python level syntax.
   ```
   
  
  
   ### 3.10.0
   ```
   ==========================

Features
--------

- `2619 &lt;https://github.com/pytest-dev/pytest/issues/2619&gt;`_: Resume capturing output after ``continue`` with ``__import__(&quot;pdb&quot;).set_trace()``.

  This also adds a new ``pytest_leave_pdb`` hook, and passes in ``pdb`` to the
  existing ``pytest_enter_pdb`` hook.


- `4147 &lt;https://github.com/pytest-dev/pytest/issues/4147&gt;`_: Add ``--sw``, ``--stepwise`` as an alternative to ``--lf -x`` for stopping at the first failure, but starting the next test invocation from that test.  See `the documentation &lt;https://docs.pytest.org/en/latest/cache.htmlstepwise&gt;`__ for more info.


- `4188 &lt;https://github.com/pytest-dev/pytest/issues/4188&gt;`_: Make ``--color`` emit colorful dots when not running in verbose mode. Earlier, it would only colorize the test-by-test output if ``--verbose`` was also passed.


- `4225 &lt;https://github.com/pytest-dev/pytest/issues/4225&gt;`_: Improve performance with collection reporting in non-quiet mode with terminals.

  The &quot;collecting …&quot; message is only printed/updated every 0.5s.



Bug Fixes
---------

- `2701 &lt;https://github.com/pytest-dev/pytest/issues/2701&gt;`_: Fix false ``RemovedInPytest4Warning: usage of Session... is deprecated, please use pytest`` warnings.


- `4046 &lt;https://github.com/pytest-dev/pytest/issues/4046&gt;`_: Fix problems with running tests in package ``__init__.py`` files.


- `4260 &lt;https://github.com/pytest-dev/pytest/issues/4260&gt;`_: Swallow warnings during anonymous compilation of source.


- `4262 &lt;https://github.com/pytest-dev/pytest/issues/4262&gt;`_: Fix access denied error when deleting stale directories created by ``tmpdir`` / ``tmp_path``.


- `611 &lt;https://github.com/pytest-dev/pytest/issues/611&gt;`_: Naming a fixture ``request`` will now raise a warning: the ``request`` fixture is internal and
  should not be overwritten as it will lead to internal errors.

- `4266 &lt;https://github.com/pytest-dev/pytest/issues/4266&gt;`_: Handle (ignore) exceptions raised during collection, e.g. with Django&#39;s LazySettings proxy class.



Improved Documentation
----------------------

- `4255 &lt;https://github.com/pytest-dev/pytest/issues/4255&gt;`_: Added missing documentation about the fact that module names passed to filter warnings are not regex-escaped.



Trivial/Internal Changes
------------------------

- `4272 &lt;https://github.com/pytest-dev/pytest/issues/4272&gt;`_: Display cachedir also in non-verbose mode if non-default.


- `4277 &lt;https://github.com/pytest-dev/pytest/issues/4277&gt;`_: pdb: improve message about output capturing with ``set_trace``.

  Do not display &quot;IO-capturing turned off/on&quot; when ``-s`` is used to avoid
  confusion.


- `4279 &lt;https://github.com/pytest-dev/pytest/issues/4279&gt;`_: Improve message and stack level of warnings issued by ``monkeypatch.setenv`` when the value of the environment variable is not a ``str``.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest
  - Changelog: https://pyup.io/changelogs/pytest/
  - Homepage: https://docs.pytest.org/en/latest/
</details>





### Update [prospector[with_everything]](https://pypi.org/project/prospector) from **1.1.4** to **1.1.6.2**.


<details>
  <summary>Changelog</summary>
  
  
   ### 1.1.6.2
   ```
   - [304](prospector-dev/prospector#304) Pin pylint to 2.1.1 for now as prospector is not compatible with 2.2.0
- [302](prospector-dev/prospector#302) Pin astroid to 2.0.4 as pylint-django and pylint-flask need fixes to be compatible with newer versions
   ```
   
  
  
   ### 1.1.6.1
   ```
   - [292](prospector-dev/prospector#292) Adding pylint plugin dependencies back and fixing autodetect behaviour.
   ```
   
  
  
   ### 1.1.5
   ```
   - [283](prospector-dev/prospector#283) Remove unexpected argument from read_config_file - Remove quiet 
argument
- [291](prospector-dev/prospector#291) Update pycodestyle support until 2.4.0
- [280](prospector-dev/prospector#280) Add strict option and fixed emacs output format for mypy tool
- [282](prospector-dev/prospector#282) Fix working dir detection
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/prospector
  - Changelog: https://pyup.io/changelogs/prospector/
  - Docs: http://prospector.readthedocs.io
</details>
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

Successfully merging this pull request may close these issues.

3 participants