diff --git a/README.md b/README.md index 4616f3d..ddded5e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ While Fixate is fairly simple, it is already being used to test real electronics ## Getting Started -Fixate runs on Python 3.7 or greater. +Fixate runs on Python 3.8 or greater. ### Installing @@ -19,32 +19,29 @@ Alternatively, install from Pypi with 'pip install fixate' ### Run the example scripts -There are a number of examples under src/fixate/examples. For a minimal example try running tiny.py. +There are a number of examples under the examples folder. +You will need a clone fo the git repository to get the examples. +For a minimal example try running tiny.py. For a more complicated example using multi-level tests, try running multi_level_design.py. -The test runner is executed by calling the package as a script with the test script to execute passed in using the -'-p' command line argument, as well as the -c command line argument to specify the config file +The test runner is executed by calling the `fixate` package and passing in the test script to execute using the '-p' command line argument. -#### Running on Windows: +The following commands are for Windows: -If running from a pip installed version of fixate the path to the examples will be "path_to_python_installation"/Lib/site-packages/fixate/examples/ From this folder the following can be executed: - -python -m fixate -p tiny.py - -Alternatively the full path to tiny.py can be provided. - -python -m fixate -p "path_to_python_installation"/Lib/site-packages/fixate/examples/tiny.py - -#### Running on MacOS: - -Running on Mac is the same as running on Windows with the exception of the path to the examples. The path will be: "path_to_python_installation"/lib/pythonX.Y/site-packages/fixate/examples/ -Where X.Y is the version of python that is installed. +```sh +git clone https://github.com/PyFixate/Fixate.git +cd Fixate +py -m venv .venv +.venv\Scripts\activate +py -m pip install . +py -m fixate -p examples\tiny.py +``` #### Running during development For easier development, test scripts can be setup to call the fixate main as their own with some default parameters, as in: -python -m fixate.examples.tiny +python examples/tiny.py Using that `__main__` example in your own test script then means you can run it as: @@ -52,15 +49,10 @@ python -m my_test_script ## Running the tests In general, it is recommended to run the "core" set of tests. -The "drivers" test have a number of dependencies that are not required by default. Tests run using unittest. -Navigate to the test/core directory and execute "python -m unittest". - -## Modifying the Qt GUI - -The Qt GUI base file is created using Qt Designer under Mingw32. -If you'd like to make changes, use pyuic5 to build the layout file, with the command: - -pyuic5 fixateGUI.ui -o layout.py +The "drivers" test have a number of dependencies that are not required by default. +Tests are run using pytest. +The easiest way to run the test is using tox. +To run the tests manually using pytest, excluding tests that required instruments, you can run `pytest -m "not drivertest"`. ## Check out the docs diff --git a/docs/fixate/fixate.examples.rst b/docs/fixate/fixate.examples.rst deleted file mode 100644 index 390d8da..0000000 --- a/docs/fixate/fixate.examples.rst +++ /dev/null @@ -1,74 +0,0 @@ -fixate.examples package -======================= - -.. automodule:: fixate.examples - :members: - :undoc-members: - :show-inheritance: - -Submodules ----------- - -fixate.examples.function\_generator module ------------------------------------------- - -.. automodule:: fixate.examples.function_generator - :members: - :undoc-members: - :show-inheritance: - -fixate.examples.jig\_driver module ----------------------------------- - -.. automodule:: fixate.examples.jig_driver - :members: - :undoc-members: - :show-inheritance: - -fixate.examples.multi\_level\_design module -------------------------------------------- - -.. automodule:: fixate.examples.multi_level_design - :members: - :undoc-members: - :show-inheritance: - -fixate.examples.programmable\_power\_supply module --------------------------------------------------- - -.. automodule:: fixate.examples.programmable_power_supply - :members: - :undoc-members: - :show-inheritance: - -fixate.examples.test\_script module ------------------------------------ - -.. automodule:: fixate.examples.test_script - :members: - :undoc-members: - :show-inheritance: - -fixate.examples.tiny module ---------------------------- - -.. automodule:: fixate.examples.tiny - :members: - :undoc-members: - :show-inheritance: - -fixate.examples.tiny\_images module ------------------------------------ - -.. automodule:: fixate.examples.tiny_images - :members: - :undoc-members: - :show-inheritance: - -fixate.examples.tiny\_variants module -------------------------------------- - -.. automodule:: fixate.examples.tiny_variants - :members: - :undoc-members: - :show-inheritance: diff --git a/src/fixate/examples/__init__.py b/examples/__init__.py similarity index 100% rename from src/fixate/examples/__init__.py rename to examples/__init__.py diff --git a/src/fixate/examples/base_test.jpg b/examples/base_test.jpg similarity index 100% rename from src/fixate/examples/base_test.jpg rename to examples/base_test.jpg diff --git a/src/fixate/examples/base_test_2.jpg b/examples/base_test_2.jpg similarity index 100% rename from src/fixate/examples/base_test_2.jpg rename to examples/base_test_2.jpg diff --git a/src/fixate/examples/function_generator.py b/examples/function_generator.py similarity index 100% rename from src/fixate/examples/function_generator.py rename to examples/function_generator.py diff --git a/src/fixate/examples/jig_driver.py b/examples/jig_driver.py similarity index 100% rename from src/fixate/examples/jig_driver.py rename to examples/jig_driver.py diff --git a/src/fixate/examples/multi_level_design.py b/examples/multi_level_design.py similarity index 100% rename from src/fixate/examples/multi_level_design.py rename to examples/multi_level_design.py diff --git a/src/fixate/examples/overlay_test.png b/examples/overlay_test.png similarity index 100% rename from src/fixate/examples/overlay_test.png rename to examples/overlay_test.png diff --git a/src/fixate/examples/overlay_test_2.png b/examples/overlay_test_2.png similarity index 100% rename from src/fixate/examples/overlay_test_2.png rename to examples/overlay_test_2.png diff --git a/src/fixate/examples/programmable_power_supply.py b/examples/programmable_power_supply.py similarity index 100% rename from src/fixate/examples/programmable_power_supply.py rename to examples/programmable_power_supply.py diff --git a/src/fixate/examples/test_script.py b/examples/test_script.py similarity index 100% rename from src/fixate/examples/test_script.py rename to examples/test_script.py diff --git a/src/fixate/examples/tiny.py b/examples/tiny.py similarity index 100% rename from src/fixate/examples/tiny.py rename to examples/tiny.py diff --git a/src/fixate/examples/tiny_images.py b/examples/tiny_images.py similarity index 100% rename from src/fixate/examples/tiny_images.py rename to examples/tiny_images.py diff --git a/src/fixate/examples/tiny_variants.py b/examples/tiny_variants.py similarity index 100% rename from src/fixate/examples/tiny_variants.py rename to examples/tiny_variants.py diff --git a/mypy.ini b/mypy.ini index 765bff0..9601a44 100644 --- a/mypy.ini +++ b/mypy.ini @@ -58,12 +58,6 @@ exclude = (?x) |__init__.py |ftdi.py ) - |examples/ - ( - function_generator.py - |programmable_power_supply.py - |test_script.py - ) ) ) warn_unused_configs = True @@ -89,5 +83,3 @@ follow_imports = silent follow_imports = silent [mypy-fixate.drivers,fixate.drivers.dso.helper,fixate.drivers.funcgen.helper,fixate.drivers.funcgen.rigol_dg1022,fixate.drivers.pps,fixate.drivers.pps.helper,fixate.drivers.ftdi] follow_imports = silent -[mypy-fixate.examples.function_generator,fixate.examples.programmable_power_supply,fixate.examples.test_script] -follow_imports = silent \ No newline at end of file