creamy-airplane-38079
01/25/2022, 6:03 PMpantsv2
test
goal to run on __init__.py
files in the test target ? If so, has anyone encountered situations where it will fail , even though they are empty files ? Tried running with debug logs but nothing meaningful is shown other than the exit code being 5high-yak-85899
01/25/2022, 6:04 PMpython_tests
target that suggests that. Here's the default for sources and you can see init files shouldn't be showing up.high-yak-85899
01/25/2022, 6:04 PMhigh-yak-85899
01/25/2022, 6:05 PMhigh-yak-85899
01/25/2022, 6:06 PMhigh-yak-85899
01/25/2022, 6:06 PMcreamy-airplane-38079
01/25/2022, 6:11 PM__init__.py
are there to help with the import of the source code. The codebase comes from an older state where it was stored as src
and tests
style and without _init_.py
, the tests will have a hard time importing the code frm src
high-yak-85899
01/25/2022, 6:12 PMcreamy-airplane-38079
01/25/2022, 6:13 PMwitty-crayon-22786
01/25/2022, 6:13 PM2.x
should skip those files and not run themhigh-yak-85899
01/25/2022, 6:13 PMcreamy-airplane-38079
01/25/2022, 6:13 PM2.9.0
witty-crayon-22786
01/25/2022, 6:14 PMBUILD
content in the relevant directory?creamy-airplane-38079
01/25/2022, 6:15 PMdtl_version = {}
with open("products/datalogue/dtl-python-sdk/datalogue/version.py") as fp:
exec(fp.read(), dtl_version)
python_sources(
name="datalogue",
sources=["datalogue/**/*.py"],
dependencies=['3rdparty/datalogue/python:requests',
'3rdparty/datalogue/python:python-dateutil',
'3rdparty/datalogue/python:validators',
'3rdparty/datalogue/python:pytest',
'3rdparty/datalogue/python:numpy',
'3rdparty/datalogue/python:pyyaml',
'3rdparty/datalogue/python:pyarrow',
'3rdparty/datalogue/python:pandas',
'3rdparty/datalogue/python:pbkdf2'
]
)
python_distribution(
provides=setup_py(
name="datalogue",
version=dtl_version["__version__"],
author="Nicolas Joseph",
author_email="<mailto:nic@datalogue.io|nic@datalogue.io>",
license="""
Copyright 2021 Datalogue, Inc.
This Datalogue SDK is licensed solely pursuant to the terms of the Master Software License executed between you as Licensee and Datalogue, Inc.
All rights reserved.
""",
description="SDK to interact with the datalogue platform",
long_description="",
long_description_content_type="text/markdown",
url="<https://github.com/datalogue/platform>",
classifiers=[
"Programming Language :: Python :: 3",
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
"Operating System :: OS Independent"
],
python_requires=">=3.6",
setup_requires=['pytest-runner'],
tests_require=['pytest>=3.6.3', 'pytest-cov>=2.6.0']
)
)
python_sources(
name="tests-utils",
sources=["tests/util/*",
"tests/kit/*"]
)
python_tests(
name='unit-tests',
sources=["tests/unit/**"],
dependencies=[":datalogue",
":tests-utils",
":test_resources"
],
)
python_tests(
name='integration-tests',
sources=["tests/integration/**", "tests/unit/**"],
dependencies=[":datalogue",
":tests-utils",
":test_resources"
],
)
resources(
name='test_resources',
sources=['products/datalogue/dtl-python-sdk/tests/resources/**/*.json',
'products/datalogue/dtl-python-sdk/tests/resources/**/*.csv',
'products/datalogue/dtl-python-sdk/tests/resources/**/*.yaml'
],
)
creamy-airplane-38079
01/25/2022, 6:15 PM./pantsv2 test products/datalogue/dtl-python-sdk:unit-tests -ldebug
witty-crayon-22786
01/25/2022, 6:17 PMpython_tests
does not glob __init__.py
files, but by globbing tests/integration/**", "tests/unit/**"
, you are including them herewitty-crayon-22786
01/25/2022, 6:17 PM"test_*.py", "*_test.py", "tests.py"
creamy-airplane-38079
01/25/2022, 6:18 PMsources
fieldcreamy-airplane-38079
01/25/2022, 6:18 PMcreamy-airplane-38079
01/25/2022, 6:18 PMwitty-crayon-22786
01/25/2022, 6:18 PMhigh-yak-85899
01/25/2022, 6:19 PMtests/unit/**, tests/unit/**/!__init__.py
(I think)witty-crayon-22786
01/25/2022, 6:19 PM"tests/integration/**/test_*.py", "tests/unit/**/test_*.py", ...
…etc, for the relevant patternscreamy-airplane-38079
01/25/2022, 6:19 PMcreamy-airplane-38079
01/25/2022, 6:19 PMwitty-crayon-22786
01/25/2022, 6:20 PMwitty-crayon-22786
01/25/2022, 6:21 PM__init__.py
files.creamy-airplane-38079
01/25/2022, 6:21 PMwitty-crayon-22786
01/25/2022, 6:22 PM./pants tailor $dir
for that directory, it would generate a very different layout, which might be a bit more maintainablewitty-crayon-22786
01/25/2022, 6:22 PMwitty-crayon-22786
01/25/2022, 6:23 PMcreamy-airplane-38079
01/25/2022, 7:07 PMcreamy-airplane-38079
01/25/2022, 7:09 PM