Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: create test-data-generation project in monorepo #14961

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions test-data-generation/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[flake8]

# max cyclomatic complexity
max-complexity = 9

extend-ignore =
# defer formatting concerns to black
# E203: space around `:` operator
# E501: maximum line length
E203,
E501,
# do not require type annotations for self nor cls
ANN101,
ANN102
# do not require docstring for __init__, put them on the class
D107,

# configure flake8-docstrings
# https://pypi.org/project/flake8-docstrings/
docstring-convention = google

noqa-require-code = true

per-file-ignores =
setup.py:ANN,D
32 changes: 32 additions & 0 deletions test-data-generation/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
include ../scripts/python.mk

.PHONY: lint
lint:
$(python) -m black --check .
$(python) -m flake8 .
$(python) -m mypy .

.PHONY: format
format:
$(python) -m black .

.PHONY: setup
setup:
$(pipenv) sync --dev

.PHONY: teardown
teardown:
$(pipenv) --rm

.PHONY: clean
clean:
rm -rf build dist *.egg-info .mypy_cache .pytest_cache src/test_data_generation.egg-info

.PHONY: wheel
wheel:
$(python) setup.py $(wheel_opts) bdist_wheel
rm -rf build

.PHONY: test
test:
$(pytest) tests -vvv
20 changes: 20 additions & 0 deletions test-data-generation/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[packages]
pytest = "==7.4.3"
black = "==23.11.0"
mypy = "==1.7.1"
flake8 = "==7.0.0"
flake8-annotations = "~=3.0.1"
flake8-docstrings = "~=1.7.0"
flake8-noqa = "~=1.4.0"
hypothesis = "==6.96.1"
opentrons-shared-data = {file = "../shared-data/python", editable = true}
test-data-generation = {file = ".", editable = true}


[requires]
python_version = "3.10"
365 changes: 365 additions & 0 deletions test-data-generation/Pipfile.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions test-data-generation/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[mypy]
show_error_codes = True
warn_unused_configs = True
strict = True
exclude = setup.py
3 changes: 3 additions & 0 deletions test-data-generation/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
addopts = --color=yes --strict-markers
asyncio_mode = auto
91 changes: 91 additions & 0 deletions test-data-generation/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Inspired by:
# https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/
import sys
import codecs
import os
import os.path
from setuptools import setup, find_packages

# make stdout blocking since Travis sets it to nonblocking
if os.name == "posix":
import fcntl

flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL)
fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)

HERE = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(HERE, "..", "scripts"))

from python_build_utils import normalize_version # noqa: E402


def get_version():
buildno = os.getenv("BUILD_NUMBER")
project = os.getenv("OPENTRONS_PROJECT", "robot-stack")
git_dir = os.getenv("OPENTRONS_GIT_DIR", None)
if buildno:
normalize_opts = {"extra_tag": buildno}
else:
normalize_opts = {}
return normalize_version(
"test-data-generation", project, git_dir=git_dir, **normalize_opts
)


VERSION = get_version()

DISTNAME = "test_data_generation"
LICENSE = "Apache 2.0"
AUTHOR = "Opentrons"
EMAIL = "[email protected]"
URL = "https://github.com/Opentrons/opentrons"
DOWNLOAD_URL = ""
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering",
]
KEYWORDS = ["robots", "protocols", "synbio", "pcr", "automation", "lab"]
DESCRIPTION = "Library for working with test data on the Opentrons robots"
PACKAGES = find_packages(where="src", exclude=["tests.*", "tests"])
INSTALL_REQUIRES = [
f"opentrons-shared-data=={VERSION}",
]


def read(*parts):
"""
Build an absolute path from *parts* and and return the contents of the
resulting file. Assume UTF-8 encoding.
"""
with codecs.open(os.path.join(HERE, *parts), "rb", "utf-8") as f:
return f.read()


if __name__ == "__main__":
setup(
python_requires="~=3.10",
name=DISTNAME,
description=DESCRIPTION,
license=LICENSE,
url=URL,
version=VERSION,
author=AUTHOR,
author_email=EMAIL,
maintainer=AUTHOR,
maintainer_email=EMAIL,
keywords=KEYWORDS,
long_description=__doc__,
packages=PACKAGES,
zip_safe=False,
classifiers=CLASSIFIERS,
install_requires=INSTALL_REQUIRES,
include_package_data=True,
package_dir={"": "src"},
package_data={"test-data-generation": ["py.typed"]},
)
Loading