Skip to content
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
2 changes: 0 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ exclude =
socs/mibs/IBOOTPDU-MIB.py,
socs/mibs/UPS-MIB.py,
socs/mibs/MBG-SYNCBOX-N2X-MIB.py,
socs/_version.py,
versioneer.py,
docs/conf.py,
per-file-ignores =
# Windows only dependency
Expand Down
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# dynamic package version
socs/_version.py

# iPython Notebooks
*.ipynb

Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sys

sys.path.insert(0, os.path.abspath('..'))
from socs._version import get_versions
from socs import __version__ as socs_version

# -- Project information -----------------------------------------------------

Expand All @@ -25,9 +25,9 @@
author = 'Simons Observatory DAQ Group'

# The short X.Y version.
version = get_versions()['version']
version = socs_version
# The full version, including alpha/beta/rc tags.
release = version
release = socs_version


# -- General configuration ---------------------------------------------------
Expand Down
130 changes: 125 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,131 @@
[build-system]
requires = [
# Upper bound needed until https://github.com/pypa/setuptools/issues/4483/ is fixed
"setuptools>=61.0,<71.0.0",
"wheel",
"versioneer-518",
"hatch-vcs",
"hatchling",
]
build-backend = "hatchling.build"

[project]
name = "socs"
dynamic = ["version"]
description = "Simons Observatory Control System"
readme = "README.rst"
requires-python = ">=3.7"
classifiers = [
"Framework :: Twisted",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Astronomy",
]
dependencies = [
"autobahn[serialization]",
"numpy",
"ocs",
"pyasn1==0.4.8",
"pyModbusTCP",
"pyserial",
"pysmi",
"pysnmp==4.4.12",
"pyyaml",
"requests",
"sqlalchemy>=1.4",
"tqdm",
"twisted",
]

[project.entry-points."ocs.plugins"]
socs = "socs.plugin"

[project.optional-dependencies]
# ACU Agent
acu = [
"pixell",
"so3g",
# "soaculib @ git+https://github.com/simonsobs/soaculib.git@master",
]
# Note: Not including the holography deps, which are Python 3.8 only. Also not
# including any dependencies with only direct references.
all = [
"labjack-ljm",
"numexpr",
"pandas",
"pfeiffer-vacuum-protocol==0.4",
"pixell",
"pyepics",
"scipy",
"so3g",
]
# Holography FPGA and Synthesizer Agents
# holography = [ # Note: supports python 3.8 only!
# "casperfpga @ git+https://github.com/casper-astro/casperfpga.git@py38",
# "holog_daq @ git+https://github.com/McMahonCosmologyGroup/holog_daq.git@main",
# ]
# Labjack Agent
labjack = [
"labjack-ljm",
"numexpr",
"scipy",
]
# Magpie Agent
magpie = [
"pandas",
"scipy",
"so3g",
]
# Pfeiffer TC 400 Agent
pfeiffer = [
"pfeiffer-vacuum-protocol==0.4",
]
# Pysmurf Controller Agent
pysmurf = [
"pyepics",
# "pysmurf @ git+https://github.com/slaclab/pysmurf.git@main",
# "sodetlib @ git+https://github.com/simonsobs/sodetlib.git@master",
# "sotodlib @ git+https://github.com/simonsobs/sotodlib.git@master",
]
# SMuRF File Emulator, SMuRF Stream Simulator
smurf_sim = [
"so3g",
]
# Timing Master Monitor
timing_master = [
"pyepics",
]
# LATRt XY Stage Agent
# xy_stage = [
# "xy_stage_control @ git+https://github.com/kmharrington/xy_stage_control.git@main",
# ]

[project.scripts]
suprsync = "socs.db.suprsync_cli:main"

[project.urls]
"Bug Tracker" = "https://github.com/simonsobs/ocs/issues"
Documentation = "https://ocs.readthedocs.io/"
Homepage = "https://github.com/simonsobs/socs"
"Source Code" = "https://github.com/simonsobs/ocs"

[tool.hatch.version]
source = "vcs"

# closest scheme to versioneer behavior, avoids auto-incremented version number
# https://setuptools-scm.readthedocs.io/en/latest/usage/#default-versioning-scheme
[tool.hatch.version.raw-options]
version_scheme = "no-guess-dev"

[tool.hatch.build.hooks.vcs]
version-file = "socs/_version.py"

[tool.hatch.build.targets.sdist]
include = [
"/socs",
]
build-backend = "setuptools.build_meta"

[tool.isort]
skip = ["versioneer.py", "socs/_version.py"]
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pyasn1==0.4.8
numpy
pyyaml
requests
tqdm

# acu agent
soaculib @ git+https://github.com/simonsobs/soaculib.git@master
Expand Down Expand Up @@ -58,5 +59,6 @@ pyModbusTCP
# Docs
# see docs/requirements.txt

# testing
# testing + development
setuptools-scm
-r requirements/testing.txt
4 changes: 2 additions & 2 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
http-server-mock
pytest
pytest-cov
pytest-docker
pytest-dependency
pytest-order
pytest-twisted
so3g
thola-snmpsim
pytest-twisted
http-server-mock
7 changes: 0 additions & 7 deletions setup.cfg

This file was deleted.

132 changes: 0 additions & 132 deletions setup.py

This file was deleted.

23 changes: 21 additions & 2 deletions socs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
from . import _version
# Define the variable '__version__':
# This has the closest behavior to versioneer that I could find
# https://github.com/maresb/hatch-vcs-footgun-example
try:
# If setuptools_scm is installed (e.g. in a development environment with
# an editable install), then use it to determine the version dynamically.
from setuptools_scm import get_version

__version__ = _version.get_versions()['version']
# This will fail with LookupError if the package is not installed in
# editable mode or if Git is not installed.
__version__ = get_version(root="..", relative_to=__file__, version_scheme="no-guess-dev")
except (ImportError, LookupError):
# As a fallback, use the version that is hard-coded in the file.
try:
from socs._version import __version__ # noqa: F401
except ModuleNotFoundError:
# The user is probably trying to run this without having installed
# the package, so complain.
raise RuntimeError(
"socs is not correctly installed. "
"Please install it with pip."
)
Loading