Skip to content

Commit

Permalink
Support python 3.6 (#4)
Browse files Browse the repository at this point in the history
Modify workflow to support 3.6

Signed-off-by: Joshua Hoskins <hoskins@squareup.com>
  • Loading branch information
friendtocephalopods authored Sep 24, 2020
1 parent 5a7aeef commit 4793064
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup python 3.7
- name: Setup python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.7
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypipublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup python 3.7
- name: Setup python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.6
- name: Add wheel dependency
run: pip install wheel
- name: Generate dist
Expand Down
1 change: 1 addition & 0 deletions amundsen_gremlin/utils/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ def _consumer(things: Iterable[V], ignored: None) -> None:
return _actual_state


# NB: This will not work on python 3.6; requires 3.7 or later
async def async_consume_in_chunks(*, stream: AsyncIterator[V], n: int, consumer: Callable[[Iterable[V]], None],
metric: Callable[[V], int] = one) -> int:
_actual_state: int = 0
Expand Down
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@

setup(
name='amundsen-gremlin',
version='0.0.2',
version='0.0.3',
description='Gremlin code library for Amundsen',
long_description=open('README.md').read(),
url='https://github.com/amundsen-io/amundsengremlin',
maintainer='Linux Foundation',
maintainer_email='amundsen-dev@lyft.com',
maintainer='Amundsen TSC',
maintainer_email='amundsen-tsc@lists.lfai.foundation',
packages=find_packages(exclude=['tests*']) + neptune_python_utils_package_names,
package_dir=neptune_python_utils_package_directories,
zip_safe=False,
dependency_links=[],
include_package_data=True,
install_requires=[],
python_requires=">=3.7",
python_requires=">=3.6",
package_data={'amundsen_gremlin': ['py.typed']},
classifiers=[
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
)
11 changes: 8 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from typing import List

import pytest
from _pytest.config import Config
from _pytest.config.argparsing import Parser
from _pytest.nodes import Item

# This file configures the roundtrip pytest option and skips roundtrip tests without it


def pytest_addoption(parser):
def pytest_addoption(parser: Parser) -> None:
parser.addoption(
"--roundtrip", action="store_true", default=False, help="Run roundtrip tests. These tests are slow and require \
a configured neptune instance."
)


def pytest_configure(config):
def pytest_configure(config: Config) -> None:
config.addinivalue_line("markers", "roundtrip: mark test as roundtrip")


def pytest_collection_modifyitems(config, items):
def pytest_collection_modifyitems(config: Config, items: List[Item]) -> None:
if config.getoption("--roundtrip"):
# --roundtrip given in cli: do not skip roundtrip tests
return
Expand Down

0 comments on commit 4793064

Please # to comment.