diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..8bd1689c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ['setuptools>=61.0'] +build-backend = 'setuptools.build_meta' \ No newline at end of file diff --git a/run_tests.py b/run_tests.py index c2bafe00..bf5d7c4e 100644 --- a/run_tests.py +++ b/run_tests.py @@ -1,4 +1,4 @@ import unittest if __name__ == '__main__': - unittest.main('flowkit.tests') + unittest.main('tests') diff --git a/setup.py b/setup.py index 61ce1080..3a13cf2d 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages # read in version string -VERSION_FILE = 'flowkit/_version.py' +VERSION_FILE = 'src/flowkit/_version.py' __version__ = None # to avoid inspection warning and check if __version__ was loaded exec(open(VERSION_FILE).read()) @@ -31,7 +31,8 @@ setup( name='FlowKit', version=__version__, # noqa PyTypeChecker - packages=find_packages(exclude=["flowkit/tests/"]), + packages=['flowkit'], + package_dir={'': 'src'}, package_data={'': ['_resources/*.xsd']}, include_package_data=True, description='Flow Cytometry Toolkit', diff --git a/flowkit/__init__.py b/src/flowkit/__init__.py similarity index 100% rename from flowkit/__init__.py rename to src/flowkit/__init__.py diff --git a/flowkit/_conf.py b/src/flowkit/_conf.py similarity index 100% rename from flowkit/_conf.py rename to src/flowkit/_conf.py diff --git a/flowkit/_models/__init__.py b/src/flowkit/_models/__init__.py similarity index 100% rename from flowkit/_models/__init__.py rename to src/flowkit/_models/__init__.py diff --git a/flowkit/_models/dimension.py b/src/flowkit/_models/dimension.py similarity index 100% rename from flowkit/_models/dimension.py rename to src/flowkit/_models/dimension.py diff --git a/flowkit/_models/gate_node.py b/src/flowkit/_models/gate_node.py similarity index 100% rename from flowkit/_models/gate_node.py rename to src/flowkit/_models/gate_node.py diff --git a/flowkit/_models/gates/__init__.py b/src/flowkit/_models/gates/__init__.py similarity index 100% rename from flowkit/_models/gates/__init__.py rename to src/flowkit/_models/gates/__init__.py diff --git a/flowkit/_models/gates/_base_gate.py b/src/flowkit/_models/gates/_base_gate.py similarity index 100% rename from flowkit/_models/gates/_base_gate.py rename to src/flowkit/_models/gates/_base_gate.py diff --git a/flowkit/_models/gates/_gates.py b/src/flowkit/_models/gates/_gates.py similarity index 100% rename from flowkit/_models/gates/_gates.py rename to src/flowkit/_models/gates/_gates.py diff --git a/flowkit/_models/gates/_gml_gates.py b/src/flowkit/_models/gates/_gml_gates.py similarity index 100% rename from flowkit/_models/gates/_gml_gates.py rename to src/flowkit/_models/gates/_gml_gates.py diff --git a/flowkit/_models/gates/_wsp_gates.py b/src/flowkit/_models/gates/_wsp_gates.py similarity index 100% rename from flowkit/_models/gates/_wsp_gates.py rename to src/flowkit/_models/gates/_wsp_gates.py diff --git a/flowkit/_models/gating_results.py b/src/flowkit/_models/gating_results.py similarity index 100% rename from flowkit/_models/gating_results.py rename to src/flowkit/_models/gating_results.py diff --git a/flowkit/_models/gating_strategy.py b/src/flowkit/_models/gating_strategy.py similarity index 100% rename from flowkit/_models/gating_strategy.py rename to src/flowkit/_models/gating_strategy.py diff --git a/flowkit/_models/sample.py b/src/flowkit/_models/sample.py similarity index 100% rename from flowkit/_models/sample.py rename to src/flowkit/_models/sample.py diff --git a/flowkit/_models/session.py b/src/flowkit/_models/session.py similarity index 100% rename from flowkit/_models/session.py rename to src/flowkit/_models/session.py diff --git a/flowkit/_models/transforms/__init__.py b/src/flowkit/_models/transforms/__init__.py similarity index 100% rename from flowkit/_models/transforms/__init__.py rename to src/flowkit/_models/transforms/__init__.py diff --git a/flowkit/_models/transforms/_base_transform.py b/src/flowkit/_models/transforms/_base_transform.py similarity index 100% rename from flowkit/_models/transforms/_base_transform.py rename to src/flowkit/_models/transforms/_base_transform.py diff --git a/flowkit/_models/transforms/_matrix.py b/src/flowkit/_models/transforms/_matrix.py similarity index 100% rename from flowkit/_models/transforms/_matrix.py rename to src/flowkit/_models/transforms/_matrix.py diff --git a/flowkit/_models/transforms/_transforms.py b/src/flowkit/_models/transforms/_transforms.py similarity index 100% rename from flowkit/_models/transforms/_transforms.py rename to src/flowkit/_models/transforms/_transforms.py diff --git a/flowkit/_models/transforms/_wsp_transforms.py b/src/flowkit/_models/transforms/_wsp_transforms.py similarity index 100% rename from flowkit/_models/transforms/_wsp_transforms.py rename to src/flowkit/_models/transforms/_wsp_transforms.py diff --git a/flowkit/_models/workspace.py b/src/flowkit/_models/workspace.py similarity index 100% rename from flowkit/_models/workspace.py rename to src/flowkit/_models/workspace.py diff --git a/flowkit/_resources/DataTypes.v2.0.xsd b/src/flowkit/_resources/DataTypes.v2.0.xsd similarity index 100% rename from flowkit/_resources/DataTypes.v2.0.xsd rename to src/flowkit/_resources/DataTypes.v2.0.xsd diff --git a/flowkit/_resources/Gating-ML.v2.0.xsd b/src/flowkit/_resources/Gating-ML.v2.0.xsd similarity index 100% rename from flowkit/_resources/Gating-ML.v2.0.xsd rename to src/flowkit/_resources/Gating-ML.v2.0.xsd diff --git a/flowkit/_resources/Transformations.v2.0.xsd b/src/flowkit/_resources/Transformations.v2.0.xsd similarity index 100% rename from flowkit/_resources/Transformations.v2.0.xsd rename to src/flowkit/_resources/Transformations.v2.0.xsd diff --git a/flowkit/_resources/__init__.py b/src/flowkit/_resources/__init__.py similarity index 100% rename from flowkit/_resources/__init__.py rename to src/flowkit/_resources/__init__.py diff --git a/flowkit/_utils/__init__.py b/src/flowkit/_utils/__init__.py similarity index 100% rename from flowkit/_utils/__init__.py rename to src/flowkit/_utils/__init__.py diff --git a/flowkit/_utils/gating_utils.py b/src/flowkit/_utils/gating_utils.py similarity index 100% rename from flowkit/_utils/gating_utils.py rename to src/flowkit/_utils/gating_utils.py diff --git a/flowkit/_utils/gml_write.py b/src/flowkit/_utils/gml_write.py similarity index 100% rename from flowkit/_utils/gml_write.py rename to src/flowkit/_utils/gml_write.py diff --git a/flowkit/_utils/plot_utils.py b/src/flowkit/_utils/plot_utils.py similarity index 100% rename from flowkit/_utils/plot_utils.py rename to src/flowkit/_utils/plot_utils.py diff --git a/flowkit/_utils/sample_utils.py b/src/flowkit/_utils/sample_utils.py similarity index 100% rename from flowkit/_utils/sample_utils.py rename to src/flowkit/_utils/sample_utils.py diff --git a/flowkit/_utils/wsp_utils.py b/src/flowkit/_utils/wsp_utils.py similarity index 100% rename from flowkit/_utils/wsp_utils.py rename to src/flowkit/_utils/wsp_utils.py diff --git a/flowkit/_utils/xml_common.py b/src/flowkit/_utils/xml_common.py similarity index 100% rename from flowkit/_utils/xml_common.py rename to src/flowkit/_utils/xml_common.py diff --git a/flowkit/_utils/xml_utils.py b/src/flowkit/_utils/xml_utils.py similarity index 100% rename from flowkit/_utils/xml_utils.py rename to src/flowkit/_utils/xml_utils.py diff --git a/flowkit/_version.py b/src/flowkit/_version.py similarity index 100% rename from flowkit/_version.py rename to src/flowkit/_version.py diff --git a/flowkit/exceptions.py b/src/flowkit/exceptions.py similarity index 100% rename from flowkit/exceptions.py rename to src/flowkit/exceptions.py diff --git a/flowkit/tests/__init__.py b/tests/__init__.py similarity index 100% rename from flowkit/tests/__init__.py rename to tests/__init__.py diff --git a/flowkit/tests/export_gml_tests.py b/tests/export_gml_tests.py similarity index 99% rename from flowkit/tests/export_gml_tests.py rename to tests/export_gml_tests.py index cce51379..135032c3 100644 --- a/flowkit/tests/export_gml_tests.py +++ b/tests/export_gml_tests.py @@ -2,16 +2,12 @@ Tests for exporting to GatingML """ import unittest -import sys -import os import glob import re from io import BytesIO import numpy as np import pandas as pd -sys.path.append(os.path.abspath('../..')) - from flowkit import Sample, Session data1_fcs_path = 'data/gate_ref/data1.fcs' diff --git a/flowkit/tests/gate_tests.py b/tests/gate_tests.py similarity index 100% rename from flowkit/tests/gate_tests.py rename to tests/gate_tests.py diff --git a/flowkit/tests/gating_results_tests.py b/tests/gating_results_tests.py similarity index 100% rename from flowkit/tests/gating_results_tests.py rename to tests/gating_results_tests.py diff --git a/flowkit/tests/gating_strategy_custom_gates_tests.py b/tests/gating_strategy_custom_gates_tests.py similarity index 97% rename from flowkit/tests/gating_strategy_custom_gates_tests.py rename to tests/gating_strategy_custom_gates_tests.py index 1a2aaae6..530afd8c 100644 --- a/flowkit/tests/gating_strategy_custom_gates_tests.py +++ b/tests/gating_strategy_custom_gates_tests.py @@ -2,13 +2,9 @@ Tests for custom gates in the GatingStrategy Class """ import copy -import os -import sys import unittest import flowkit as fk -sys.path.append(os.path.abspath('../..')) - class GatingStrategyCustomGatesTestCase(unittest.TestCase): def setUp(self): diff --git a/flowkit/tests/gating_strategy_prog_gate_tests.py b/tests/gating_strategy_prog_gate_tests.py similarity index 99% rename from flowkit/tests/gating_strategy_prog_gate_tests.py rename to tests/gating_strategy_prog_gate_tests.py index 3c59ceb5..10d230a9 100644 --- a/flowkit/tests/gating_strategy_prog_gate_tests.py +++ b/tests/gating_strategy_prog_gate_tests.py @@ -3,13 +3,9 @@ """ import copy import unittest -import sys -import os import numpy as np import pandas as pd -sys.path.append(os.path.abspath('../..')) - import flowkit as fk data1_fcs_path = 'data/gate_ref/data1.fcs' diff --git a/flowkit/tests/gating_strategy_remove_gates_tests.py b/tests/gating_strategy_remove_gates_tests.py similarity index 100% rename from flowkit/tests/gating_strategy_remove_gates_tests.py rename to tests/gating_strategy_remove_gates_tests.py diff --git a/flowkit/tests/gating_strategy_reused_gates_tests.py b/tests/gating_strategy_reused_gates_tests.py similarity index 100% rename from flowkit/tests/gating_strategy_reused_gates_tests.py rename to tests/gating_strategy_reused_gates_tests.py diff --git a/flowkit/tests/gating_strategy_tests.py b/tests/gating_strategy_tests.py similarity index 100% rename from flowkit/tests/gating_strategy_tests.py rename to tests/gating_strategy_tests.py diff --git a/flowkit/tests/gatingml_tests.py b/tests/gatingml_tests.py similarity index 99% rename from flowkit/tests/gatingml_tests.py rename to tests/gatingml_tests.py index c7204e77..c8d3a257 100644 --- a/flowkit/tests/gatingml_tests.py +++ b/tests/gatingml_tests.py @@ -1,14 +1,10 @@ import unittest -import sys -import os import glob import re import numpy as np import pandas as pd -sys.path.append(os.path.abspath('../..')) - -from flowkit import Sample, GatingStrategy, Session, gates, parse_gating_xml +from flowkit import Sample, GatingStrategy, Session, parse_gating_xml data1_fcs_path = 'data/gate_ref/data1.fcs' data1_sample = Sample(data1_fcs_path) diff --git a/flowkit/tests/matrix_tests.py b/tests/matrix_tests.py similarity index 100% rename from flowkit/tests/matrix_tests.py rename to tests/matrix_tests.py diff --git a/flowkit/tests/plot_tests.py b/tests/plot_tests.py similarity index 100% rename from flowkit/tests/plot_tests.py rename to tests/plot_tests.py diff --git a/flowkit/tests/sample_export_tests.py b/tests/sample_export_tests.py similarity index 100% rename from flowkit/tests/sample_export_tests.py rename to tests/sample_export_tests.py diff --git a/flowkit/tests/sample_tests.py b/tests/sample_tests.py similarity index 99% rename from flowkit/tests/sample_tests.py rename to tests/sample_tests.py index 35e6e56d..d8e0d880 100644 --- a/flowkit/tests/sample_tests.py +++ b/tests/sample_tests.py @@ -3,16 +3,12 @@ """ import copy import unittest -import sys -import os from pathlib import Path import numpy as np import pandas as pd import flowio import warnings -sys.path.append(os.path.abspath('../..')) - from flowkit import Sample, transforms, read_multi_dataset_fcs from flowkit.exceptions import DataOffsetDiscrepancyError diff --git a/flowkit/tests/session_export_tests.py b/tests/session_export_tests.py similarity index 100% rename from flowkit/tests/session_export_tests.py rename to tests/session_export_tests.py diff --git a/flowkit/tests/session_tests.py b/tests/session_tests.py similarity index 98% rename from flowkit/tests/session_tests.py rename to tests/session_tests.py index 6d8299b9..cd20f4f7 100644 --- a/flowkit/tests/session_tests.py +++ b/tests/session_tests.py @@ -3,13 +3,9 @@ """ import copy import unittest -import sys -import os import numpy as np import pandas as pd -sys.path.append(os.path.abspath('../..')) - from flowkit import Session, Sample, Matrix, Dimension, gates, transforms, load_samples from .gating_strategy_prog_gate_tests import data1_sample, poly1_gate, poly1_vertices, comp_matrix_01, asinh_xform1 diff --git a/flowkit/tests/string_repr_tests.py b/tests/string_repr_tests.py similarity index 100% rename from flowkit/tests/string_repr_tests.py rename to tests/string_repr_tests.py diff --git a/flowkit/tests/transform_tests.py b/tests/transform_tests.py similarity index 100% rename from flowkit/tests/transform_tests.py rename to tests/transform_tests.py diff --git a/flowkit/tests/workspace_tests.py b/tests/workspace_tests.py similarity index 100% rename from flowkit/tests/workspace_tests.py rename to tests/workspace_tests.py