Skip to content

Commit

Permalink
Add special installs to setup (#116)
Browse files Browse the repository at this point in the history
* Add extras installs to setup

* Fix imports in tests

* Add new python versions to test CI
  • Loading branch information
j6k4m8 committed May 15, 2022
1 parent 09626f2 commit 16e5f84
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: [3.7, 3.8, 3.9, '3.10']

steps:

Expand Down
7 changes: 6 additions & 1 deletion dotmotif/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@

from .executors.NetworkXExecutor import NetworkXExecutor
from .executors.GrandIsoExecutor import GrandIsoExecutor
from .executors.Neo4jExecutor import Neo4jExecutor

try:
# For backwards compatibility:
from .executors.Neo4jExecutor import Neo4jExecutor
except ImportError:
pass

__version__ = "0.11.0"

Expand Down
3 changes: 1 addition & 2 deletions dotmotif/executors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright 2020 The Johns Hopkins University Applied Physics Laboratory.
Copyright 2022 The Johns Hopkins University Applied Physics Laboratory.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,5 @@
"""

from .Executor import Executor
from .Neo4jExecutor import Neo4jExecutor
from .NetworkXExecutor import NetworkXExecutor
from .GrandIsoExecutor import GrandIsoExecutor
2 changes: 1 addition & 1 deletion dotmotif/executors/test_dm_cypher.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import unittest
import dotmotif
from dotmotif.executors import Neo4jExecutor
from dotmotif.executors.Neo4jExecutor import Neo4jExecutor


_DEMO_G_MIN = """
Expand Down
4 changes: 0 additions & 4 deletions dotmotif/executors/test_grandisoexecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
import dotmotif
from dotmotif import Motif
from dotmotif.executors import GrandIsoExecutor
from dotmotif.executors.NetworkXExecutor import (
_edge_satisfies_constraints,
_node_satisfies_constraints,
)
from dotmotif.parsers.v2 import ParserV2
import networkx as nx

Expand Down
9 changes: 4 additions & 5 deletions dotmotif/executors/test_neuprintexecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
HOST = "neuprint.janelia.org"
DATASET = "hemibrain:v1.1"
TOKEN = os.getenv("NEUPRINT_TOKEN")
if TOKEN:

import unittest

from .. import Motif
from .NeuPrintExecutor import NeuPrintExecutor
import unittest

if TOKEN:
from .. import Motif
from .NeuPrintExecutor import NeuPrintExecutor

class TestNeuPrintConnection(unittest.TestCase):
def test_can_get_version(self):
Expand Down
5 changes: 0 additions & 5 deletions dotmotif/ingest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
# Standard installs:
import abc
import json
import os
import numbers

# Non-standard installs:
import dask.dataframe as dd
import pandas as pd

# Types only:
from typing import List
import networkx as nx

from .. import utils


class NetworkXConverter(abc.ABC):
"""
Expand Down
7 changes: 4 additions & 3 deletions dotmotif/tests/test_dm_flags.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import unittest
import dotmotif
import networkx as nx
from dotmotif.executors import Neo4jExecutor, NetworkXExecutor
from dotmotif.executors.Neo4jExecutor import Neo4jExecutor
from dotmotif.executors.GrandIsoExecutor import GrandIsoExecutor


_DEMO_G_MIN = """
Expand Down Expand Up @@ -78,7 +79,7 @@ def test_from_nx_import(self):
g.add_edge("A", "B")
dm = dotmotif.Motif().from_nx(g)

E = NetworkXExecutor(graph=G)
E = GrandIsoExecutor(graph=G)
self.assertEqual(len(E.find(dm)), 4)

def test_from_nx_import(self):
Expand All @@ -90,5 +91,5 @@ def test_from_nx_import(self):
g.add_edge("A", "B")
dm = dotmotif.Motif(ignore_direction=True).from_nx(g)

E = NetworkXExecutor(graph=G)
E = GrandIsoExecutor(graph=G)
self.assertEqual(len(E.find(dm)), 4)
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ lark-parser
docker
pandas
py2neo
dask[dataframe]
tamarind>=0.2.0
neuprint-python
grandiso>=2.1.0
17 changes: 11 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,21 @@
packages=find_packages(exclude=["tests", "*.tests", "*.tests.*", "tests.*"]),
classifiers=[],
install_requires=[
"networkx",
"networkx>2.4",
"numpy",
"lark-parser",
"docker",
"pandas",
"py2neo",
"dask[dataframe]",
"tamarind>=0.1.5",
"neuprint-python",
"grandiso>=2.0.0",
],
extras_require={
"neo4j": [
"docker",
"tamarind>=0.1.5",
"py2neo",
],
"neuprint": [
"neuprint-python",
],
},
include_package_data=True,
)

0 comments on commit 16e5f84

Please sign in to comment.