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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
# The codegen scripts require Python 3.8 or later.
python-version: "3.8"
# The codegen scripts require Python 3.9 or later.
python-version: "3.9"
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
# Fail-fast skews the pass/fail ratio and seems to make pytest produce
# incomplete JUnit XML results.
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ All notable changes to this project will be documented in this file.

* ### Major Changes
* Added support for mioDAQ configurable digital voltage.
* Removed support for Python 3.8.

* ### Known Issues
* ...
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ through our [GitHub issues page](http://github.com/ni/nidaqmx-python/issues).
6. Make your change.
7. Once the necessary changes are done, update the auto-generated code using ``poetry run python src/codegen --dest generated/nidaqmx``. This will ensure that the latest files are present in the ``generated`` folder.
> **Note**
> The codegen scripts require Python 3.8 or later.
> The codegen scripts require Python 3.9 or later.
8. Run all the regression tests again (including the tests you just added), and confirm that they all
pass.
9. Run `poetry run ni-python-styleguide lint` to check that the updated code follows NI's Python coding
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ system.
Python Version Support
----------------------

**nidaqmx** supports CPython 3.8+ and PyPy3.
**nidaqmx** supports CPython 3.9+ and PyPy3.

Installation
============
Expand Down
7 changes: 1 addition & 6 deletions generated/nidaqmx/_time.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
from __future__ import annotations

import sys
from tzlocal import get_localzone
from datetime import timezone
from datetime import tzinfo as dt_tzinfo
from datetime import datetime as std_datetime
from hightime import datetime as ht_datetime
from typing import Optional, Union

if sys.version_info >= (3, 9):
from zoneinfo import ZoneInfo
else:
from backports.zoneinfo import ZoneInfo
from zoneinfo import ZoneInfo

# theoretically the same as astimezone(), but with support for dates before 1970
def _convert_to_desired_timezone(expected_time_utc: Union[std_datetime, ht_datetime], tzinfo: Optional[dt_tzinfo] = None) -> Union[std_datetime, ht_datetime]:
Expand Down
47 changes: 2 additions & 45 deletions poetry.lock

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

7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ classifiers = [
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -32,9 +31,9 @@ exclude = ["nidaqmx/tests"]
packages = [{ include = "nidaqmx", from = "generated" }]

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
numpy = [
{version = ">=1.22", python = ">=3.8,<3.12"},
{version = ">=1.22", python = ">=3.9,<3.12"},
{version = ">=1.26", python = ">=3.12,<3.13"},
{version = ">=2.1", python = "^3.13"},
]
Expand Down Expand Up @@ -63,7 +62,7 @@ grpc = ["grpcio", "protobuf"]
click = "^8.1"
Mako = "^1.2"
grpcio-tools = [
{version = "1.49.1", python = ">=3.8,<3.12"},
{version = "1.49.1", python = ">=3.9,<3.12"},
{version = "1.59.0", python = ">=3.12,<3.13"},
{version = "1.67.0", python = "^3.13"},
]
Expand Down
7 changes: 1 addition & 6 deletions src/handwritten/_time.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
from __future__ import annotations

import sys
from tzlocal import get_localzone
from datetime import timezone
from datetime import tzinfo as dt_tzinfo
from datetime import datetime as std_datetime
from hightime import datetime as ht_datetime
from typing import Optional, Union

if sys.version_info >= (3, 9):
from zoneinfo import ZoneInfo
else:
from backports.zoneinfo import ZoneInfo
from zoneinfo import ZoneInfo

# theoretically the same as astimezone(), but with support for dates before 1970
def _convert_to_desired_timezone(expected_time_utc: Union[std_datetime, ht_datetime], tzinfo: Optional[dt_tzinfo] = None) -> Union[std_datetime, ht_datetime]:
Expand Down
15 changes: 3 additions & 12 deletions tests/acceptance/test_multi_threading.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import concurrent.futures
import functools
import random
import sys
import threading
import time
from concurrent.futures import Future, ThreadPoolExecutor
Expand Down Expand Up @@ -50,7 +49,7 @@ def test___single_task___get_set_float_properties___no_errors(

start_barrier.wait(timeout=TIMEOUT)
time.sleep(RUN_TIME)
_release_n(stop_semaphore, num_channels)
stop_semaphore.release(num_channels)

concurrent.futures.wait(futures)
_check_for_exceptions(futures)
Expand Down Expand Up @@ -92,7 +91,7 @@ def test___single_task___get_set_float_and_string_properties___no_errors(

start_barrier.wait(timeout=TIMEOUT)
time.sleep(RUN_TIME)
_release_n(stop_semaphore, num_channels)
stop_semaphore.release(num_channels)

concurrent.futures.wait(futures)
_check_for_exceptions(futures)
Expand Down Expand Up @@ -139,7 +138,7 @@ def test___multiple_tasks___get_set_float_and_string_properties___no_errors(

start_barrier.wait(timeout=TIMEOUT)
time.sleep(RUN_TIME)
_release_n(stop_semaphore, num_tasks)
stop_semaphore.release(num_tasks)

concurrent.futures.wait(futures)
_check_for_exceptions(futures)
Expand All @@ -164,14 +163,6 @@ def _check_for_exceptions(futures: Sequence[Future]) -> None:
_ = future.result()


def _release_n(semaphore: Semaphore, n: int) -> None:
if sys.version_info < (3, 9):
for i in range(n):
semaphore.release()
else:
semaphore.release(n)


def test___shared_interpreter___run_multiple_acquisitions_with_events___callbacks_invoked(
init_kwargs,
multi_threading_test_devices: Sequence[Device],
Expand Down
7 changes: 1 addition & 6 deletions tests/unit/test_grpc_time.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from datetime import datetime as std_datetime, timedelta, timezone
from zoneinfo import ZoneInfo

import pytest
from hightime import datetime as ht_datetime
Expand All @@ -19,11 +19,6 @@
except ImportError:
pass

if sys.version_info >= (3, 9):
from zoneinfo import ZoneInfo
else:
from backports.zoneinfo import ZoneInfo


@pytest.mark.parametrize("from_dt", [(JAN_01_2002_DATETIME), (JAN_01_2002_HIGHTIME)])
def test___utc_datetime_after_1970___convert_to_timestamp___is_reversible(from_dt):
Expand Down
7 changes: 1 addition & 6 deletions tests/unit/test_lib_time.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import random
import sys
from copy import copy
from datetime import datetime as std_datetime, timedelta, timezone
from zoneinfo import ZoneInfo

import pytest
from hightime import datetime as ht_datetime
Expand All @@ -19,11 +19,6 @@
JAN_01_2002_TIMESTAMP_1904_EPOCH,
)

if sys.version_info >= (3, 9):
from zoneinfo import ZoneInfo
else:
from backports.zoneinfo import ZoneInfo

JAN_01_2002_LIB = LibTimestamp(lsb=0, msb=JAN_01_2002_TIMESTAMP_1904_EPOCH)
JAN_01_1904_LIB = LibTimestamp(lsb=0, msb=JAN_01_1904_TIMESTAMP_1904_EPOCH)
JAN_01_1850_LIB = LibTimestamp(lsb=0, msb=JAN_01_1850_TIMESTAMP_1904_EPOCH)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[tox]
isolated_build = true
envlist = clean, py{38,39,310,311,312,313}-base, py{38,39,310,311,312,313}-grpc, py39-base-nicaiu, py39-base-nicai_utf8, report, docs
envlist = clean, py{39,310,311,312,313}-base, py{39,310,311,312,313}-grpc, py39-base-nicaiu, py39-base-nicai_utf8, report, docs

[testenv]
skip_install = true
Expand Down