diff --git a/.gitignore b/.gitignore index f8ec13f..0b5cb05 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ build dist pyvcam.egg-info +__pycache__/ +*.py[cod] diff --git a/README.md b/README.md index a825f99..10b5051 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -# PyVCAM Wrapper - -PyVCAM Wrapper is a Python3.X wrapper for the PVCAM SDK. +# PyVCAM Wrapper + +> This fork is deprecated. Photometrics has since incorporated the live-mode +> queue fix from PR #45 while closing issue #35, so downstream users should +> install the maintained upstream package from PyPI instead of using this fork. + +PyVCAM Wrapper is a Python3.X wrapper for the PVCAM SDK. ## Getting Started Follow the instructions below to get PyVCAM up and running on your machine for development and testing. @@ -14,10 +18,14 @@ Follow the instructions below to get PyVCAM up and running on your machine for d * PyVCAM was developed and tested using Microsoft Windows 10/64-bit. The build package also supports Linux, but testing has been minimal. -### Installing -When you are ready to install the wrapper use your command prompt to navigate into the directory that contains -setup.py and run ```python setup.py install``` - +### Installing +Use the maintained upstream release from Photometrics instead of installing this +fork from source: + +```bash +python -m pip install --upgrade PyVCAM +``` + ### How to use the wrapper #### Create Camera Example @@ -50,4 +58,4 @@ cam.speed_table_index = 0 cam.gain = 1 ``` -More information on how to use this wrapper and how it works can be found [here](https://github.com/Photometrics/PyVCAM/blob/master/docs/PyVCAM%20Wrapper.md). +More information on how to use this wrapper and how it works can be found [here](https://github.com/Photometrics/PyVCAM/blob/master/docs/PyVCAM%20Wrapper.md). diff --git a/docs/CheetSheet.txt b/docs/CheetSheet.txt index 2fa0a75..5602f2a 100644 --- a/docs/CheetSheet.txt +++ b/docs/CheetSheet.txt @@ -1,5 +1,5 @@ [[Installation]] -python setup.py install +python -m pip install --upgrade PyVCAM [[Camera Class]] diff --git a/docs/PyVCAM Wrapper.md b/docs/PyVCAM Wrapper.md index 46b1baa..3f3a8ab 100644 --- a/docs/PyVCAM Wrapper.md +++ b/docs/PyVCAM Wrapper.md @@ -1,4 +1,8 @@ -# PyVCAM Wrapper +# PyVCAM Wrapper + +> This fork is deprecated. Photometrics has since incorporated the live-mode +> queue fix from PR #45 while closing issue #35, so downstream users should +> install the maintained upstream package from PyPI instead of using this fork. - [PyVCAM Wrapper](#pyvcam-wrapper) * [src](#src) diff --git a/src/pyvcam/__init__.py b/src/pyvcam/__init__.py index e69de29..50302d9 100644 --- a/src/pyvcam/__init__.py +++ b/src/pyvcam/__init__.py @@ -0,0 +1,11 @@ +"""Local fork deprecation notice for PyVCAM.""" + +from warnings import warn + + +warn( + "This fork of PyVCAM is deprecated. Install the maintained " + "Photometrics release from PyPI instead.", + DeprecationWarning, + stacklevel=2, +) diff --git a/tests/test_deprecated_fork.py b/tests/test_deprecated_fork.py new file mode 100644 index 0000000..50bd141 --- /dev/null +++ b/tests/test_deprecated_fork.py @@ -0,0 +1,24 @@ +import importlib +import pathlib +import sys +import unittest +import warnings + + +SRC_DIR = pathlib.Path(__file__).resolve().parents[1] / "src" + + +class DeprecatedForkTests(unittest.TestCase): + def test_import_warns_to_use_upstream_release(self): + sys.path.insert(0, str(SRC_DIR)) + try: + sys.modules.pop("pyvcam", None) + with warnings.catch_warnings(record=True) as caught: + warnings.simplefilter("always") + importlib.import_module("pyvcam") + finally: + sys.modules.pop("pyvcam", None) + sys.path.remove(str(SRC_DIR)) + + self.assertGreater(len(caught), 0) + self.assertIn("Photometrics release from PyPI", str(caught[0].message))