• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 6393 / 2
0%
main: 93%

Build:
Build:
LAST BUILD BRANCH: fix_pex_test
DEFAULT BRANCH: main
Ran 24 Aug 2015 10:40PM UTC
Files 373
Run time 10s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Aug 2015 10:13PM UTC coverage: 70.638%. Remained the same
CI_FLAGS="-fkmsrcn -u 0/2 'Unit tests for pants and pants-plugins - shard 1'"

push

travis-ci

jsirois
Ensure stdlib check uses normalized paths.

Previously, it was observed that the python __file__ might point to a
symlinked path whereas the `sysconfig.get_python_lib(standard_lib=1)`
path might be to the real path.  This led to mis-categorization of
stdlib imports as third party.  This fix ensures all paths are realpaths
to remove any ambiguity.

Also remove the unused PLAT_SPECIFIC_PATH.

Testing Done:
Before the fix got errors like:
```console
$ ./pants test tests/python/pants_test/backend/python/tasks/checkstyle -- -vktest_classify_import
...
   def test_classify_import():
     for index, (import_type, chunk) in enumerate(IMPORT_CHUNKS.items()):
       io = ImportOrder(PythonFile(chunk))
       import_chunks = list(io.iter_import_chunks())
       assert len(import_chunks) == 1
       module_types, chunk_errors = io.classify_imports(import_chunks[0])
       assert len(module_types) == 1
>       assert module_types.pop() == import_type, print('>>> [{}] type: {} chunk: {}'.format(index, import_type, chunk))
E       AssertionError: None
E       assert 5 == 1
E        +  where 5 = <built-in method pop of set object at 0x7ff8cf8814d8>()
E        +    where <built-in method pop of set object at 0x7ff8cf8814d8> = set([]).pop
```

This was on arch linux where:
```console
$ ls -l /usr/lib64
lrwxrwxrwx 1 root root 3 Feb 15  2015 /usr/lib64 -> lib
```

And debug prints revealed:
```console
>>> iter: 0 type: 1 chunk:
import ast
from collections import namedtuple
import io
>>> __file__: /usr/lib64/python2.7/ast.pyc stdlib: /usr/lib/python2.7
>>> __file__: /usr/lib64/python2.7/collections.pyc stdlib: /usr/lib/python2.7
>>> __file__: /usr/lib64/python2.7/io.pyc stdlib: /usr/lib/python2.7
```

CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/77063786

Bugs closed: 2005, 2054, 2059

Reviewed at https://rbcommons.com/s/twitter/r/2693/

15842 of 22427 relevant lines covered (70.64%)

0.71 hits per line

Source Files on job 6393.2 (CI_FLAGS="-fkmsrcn -u 0/2 'Unit tests for pants and pants-plugins - shard 1'")
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 6393
  • Travis Job 6393.2
  • 318b423e on github
  • Prev Job for CI_FLAGS="-fkmsrcn -u 0/2 'Unit tests for pants and pants-plugins - shard 1'" on master (#6388.2)
  • Next Job for CI_FLAGS="-fkmsrcn -u 0/2 'Unit tests for pants and pants-plugins - shard 1'" on master (#6419.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc