Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekMaggio committed Apr 5, 2024
2 parents 1d039b0 + 71cb584 commit 5f583b1
Show file tree
Hide file tree
Showing 9 changed files with 171 additions and 73 deletions.
5 changes: 4 additions & 1 deletion performance-metrics/.flake8
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ extend-ignore =
# https://pypi.org/project/flake8-docstrings/
docstring-convention = google

noqa-require-code = true
noqa-require-code = true

per-file-ignores =
setup.py:ANN,D
13 changes: 12 additions & 1 deletion performance-metrics/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include ../scripts/python.mk

.PHONY: lint
lint:
pipenv run python -m black --check .
Expand All @@ -14,4 +16,13 @@ setup:

.PHONY: teardown
teardown:
pipenv --rm
pipenv --rm

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

.PHONY: wheel
wheel:
pipenv run python setup.py $(wheel_opts) bdist_wheel
rm -rf build
1 change: 0 additions & 1 deletion performance-metrics/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ opentrons-shared-data = {file = "../shared-data/python", editable = true}
[dev-packages]
pytest = "==7.2.2"
mypy = "==1.8.0"
# For Github Flavored Markdown
flake8 = "==7.0.0"
flake8-annotations = "~=3.0.1"
flake8-docstrings = "~=1.7.0"
Expand Down
115 changes: 58 additions & 57 deletions performance-metrics/Pipfile.lock

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

5 changes: 5 additions & 0 deletions performance-metrics/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
13 changes: 0 additions & 13 deletions performance-metrics/pyproject.toml

This file was deleted.

91 changes: 91 additions & 0 deletions performance-metrics/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(
"performance-metrics", project, git_dir=git_dir, **normalize_opts
)


VERSION = get_version()

DISTNAME = "performance_metrics"
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 performance metrics 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={"performance-metrics": ["py.typed"]},
)
1 change: 1 addition & 0 deletions performance-metrics/src/performance_metrics/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Opentrons performance metrics library."""
Empty file.

0 comments on commit 5f583b1

Please sign in to comment.