Skip to content

Commit

Permalink
fix(deps): Move pyarrow and viztracer extras to main dependencies (
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Mar 8, 2023
1 parent b30a713 commit 170275b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 101 deletions.
7 changes: 1 addition & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"pytest-durations",
"freezegun",
"pandas",
"pyarrow",
"requests-mock",
# Cookiecutter tests
"black",
Expand Down Expand Up @@ -76,12 +77,6 @@ def tests(session: Session) -> None:
session.install(".[s3]")
session.install(*test_dependencies)

# temp fix until pyarrow is supported on python 3.11
if session.python != "3.11":
session.install(
"pyarrow",
)

try:
session.run(
"coverage",
Expand Down
102 changes: 37 additions & 65 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ docs = [
"sphinx_reredirects",
]
s3 = ["fs-s3fs"]
# Mark these as extras so that installs pass on python 3.11
samples = [
"pyarrow",
]
debugging = [
"viztracer",
]
testing = [
"pytest",
"pytest-durations"
Expand All @@ -105,9 +98,11 @@ xdoctest = "^1.1.1"
mypy = "^1.0"
cookiecutter = "^2.1.1"
PyYAML = "^6.0"
pyarrow = {version = "^11.0.0", optional = true, python = "<3.11"}
freezegun = "^1.2.2"
viztracer = {version = "^0.15.6", optional = true, python = "<3.11"}
numpy = [
{ version = "<1.22", python = "<3.8" },
{ version = ">=1.22", python = ">=3.8" },
]
requests-mock = "^1.10.0"
sqlalchemy2-stubs = {version = "^0.0.2a32", allow-prereleases = true}
types-jsonschema = "^4.17.0.6"
Expand All @@ -117,6 +112,7 @@ types-requests = "^2.28.11"
types-simplejson = "^3.18.0"
types-PyYAML = "^6.0.12"
coverage = {extras = ["toml"], version = "^7.2"}
pyarrow = "^11.0.0"
pytest-snapshot = "^0.9.0"

# Cookiecutter tests
Expand Down
38 changes: 17 additions & 21 deletions tests/samples/test_target_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,32 @@
from __future__ import annotations

import shutil
import sys
import uuid
from pathlib import Path

import pytest

from samples.sample_target_parquet.parquet_target import SampleTargetParquet
from singer_sdk.testing import get_target_test_class

# temporary exclude of python 3.11
# TODO: remove when pyarrow is supported by 3.11
if sys.version_info < (3, 11):
from samples.sample_target_parquet.parquet_target import SampleTargetParquet
SAMPLE_FILEPATH = Path(f".output/test_{uuid.uuid4()}/")
SAMPLE_FILENAME = SAMPLE_FILEPATH / "testfile.parquet"
SAMPLE_CONFIG = {"filepath": str(SAMPLE_FILENAME)}

SAMPLE_FILEPATH = Path(f".output/test_{uuid.uuid4()}/")
SAMPLE_FILENAME = SAMPLE_FILEPATH / "testfile.parquet"
SAMPLE_CONFIG = {"filepath": str(SAMPLE_FILENAME)}
StandardTests = get_target_test_class(
target_class=SampleTargetParquet, config=SAMPLE_CONFIG
)

StandardTests = get_target_test_class(
target_class=SampleTargetParquet, config=SAMPLE_CONFIG
)

class TestSampleTargetParquet(StandardTests):
"""Standard Target Tests."""
class TestSampleTargetParquet(StandardTests):
"""Standard Target Tests."""

@pytest.fixture(scope="class")
def test_output_dir(self):
return SAMPLE_FILEPATH
@pytest.fixture(scope="class")
def test_output_dir(self):
return SAMPLE_FILEPATH

@pytest.fixture(scope="class")
def resource(self, test_output_dir):
test_output_dir.mkdir(parents=True, exist_ok=True)
yield test_output_dir
shutil.rmtree(test_output_dir)
@pytest.fixture(scope="class")
def resource(self, test_output_dir):
test_output_dir.mkdir(parents=True, exist_ok=True)
yield test_output_dir
shutil.rmtree(test_output_dir)

0 comments on commit 170275b

Please sign in to comment.