Skip to content
Open
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
22 changes: 12 additions & 10 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
environment: test
strategy:
max-parallel: 1
matrix:
python-version: [3.7]
python-version: [3.9, 3.12]
env:
MYGEOTAB_DATABASE: ${{ secrets.MYGEOTAB_DATABASE }}
MYGEOTAB_USERNAME: ${{ secrets.MYGEOTAB_USERNAME }}
Expand All @@ -26,23 +26,25 @@ jobs:
MYGEOTAB_PASSWORD_ASYNC: ${{ secrets.MYGEOTAB_PASSWORD_ASYNC }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade setuptools pip pipenv
pipenv install --skip-lock --dev -e .
uv sync --dev
uv pip install -e .
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
pipenv run ruff check . --select=E9,F63,F7,F82 --output-format=full
uv run ruff check . --select=E9,F63,F7,F82 --output-format=full
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
pipenv run ruff check . --exit-zero
uv run ruff check . --exit-zero
- name: Test with pytest
run: |
pipenv run py.test --cov-config .coveragerc --cov-report xml:output/coverage.xml --cov mygeotab --junitxml output/python${{ matrix.python-version }}-test-results.xml --benchmark-min-rounds=3 --benchmark-storage=file://output/ --benchmark-autosave tests/
uv run pytest --cov-config .coveragerc --cov-report xml:output/coverage.xml --cov mygeotab --junitxml output/python${{ matrix.python-version }}-test-results.xml --benchmark-min-rounds=3 --benchmark-storage=file://output/ --benchmark-autosave tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.0
3.12
14 changes: 11 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@
Changes
-------

TBD
+++
Future
++++++

**Improvements**

- Centralized and better handling of new parameters in API calls (like `resultsLimit`, `search`, and `propertySelector`) `#127 <https://github.com/Geotab/mygeotab-python/pull/127>__`.
- Drops support for Python 3.8 and older.
- Changes project structure to `uv` to manage dependencies and virtual environments.

0.9.3 (2025-09-05)
++++++++++++++++++

**Improvements**

- Centralized and better handling of new parameters in API calls (like `resultsLimit`, `search`, and `propertySelector`) `#127 <https://github.com/Geotab/mygeotab-python/pull/127>`__.
- Removes deprecated SSL parameters for SSL context creation `#125 <https://github.com/Geotab/mygeotab-python/pull/125>`__.

0.9.2 (2024-10-08)
++++++++++++++++++
Expand Down
27 changes: 0 additions & 27 deletions Pipfile

This file was deleted.

2,128 changes: 0 additions & 2,128 deletions Pipfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Features

- Automatic serializing and deserializing of API call results
- Clean, Pythonic API for querying data
- Cross-platform and compatible with Python 3.7+
- Cross-platform and compatible with Python 3.9+
- A `myg` command-line tool for interactively working with data in a terminal

Usage
Expand Down
2 changes: 1 addition & 1 deletion examples/data_feed/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
click==7.0
mygeotab==0.9.2
mygeotab==0.9.3
70 changes: 70 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# justfile for mygeotab-python development tasks

# Install dependencies for development
install:
uv sync --dev
uv pip install -e .

# Run tests
test:
uv run pytest

# Run tests with coverage
test-cov:
uv run pytest --cov=mygeotab --cov-report=term-missing --cov-report=html

# Run linting
lint:
uv run ruff check .

# Run linting and fix issues
lint-fix:
uv run ruff check . --fix

# Format code
format:
uv run ruff format .

# Run type checking
type-check:
uv run mypy mygeotab

# Build the package
build:
uv build

# Clean build artifacts
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
find . -type d -name __pycache__ -delete
find . -type f -name "*.pyc" -delete

# Run all checks (lint, format, type-check, test)
check: lint format type-check test

# Install pre-commit hooks (if using pre-commit)
setup-hooks:
uv pip install pre-commit
pre-commit install

# Update dependencies
update:
uv sync --upgrade

# Show outdated dependencies
outdated:
uv pip list --outdated

# Create a virtual environment
venv:
uv venv

# Activate virtual environment (prints activation command)
activate:
echo "Run: source .venv/bin/activate"

# Run the CLI tool
run-cli *args:
uv run myg {{args}}
2 changes: 1 addition & 1 deletion mygeotab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__title__ = "mygeotab-python"
__author__ = "Geotab Inc."
__version__ = "0.9.2"
__version__ = "0.9.3"

from .api import Credentials, server_call
from .exceptions import MyGeotabException, AuthenticationException, TimeoutException
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mypy]
python_version = 3.7
python_version = 3.9
exclude = docs

[mypy-rapidjson.*]
Expand Down
93 changes: 92 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@
[build-system]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "mygeotab"
dynamic = ["version"]
description = "A Python client for the MyGeotab SDK"
authors = [
{ name = "Geotab Inc." }
]
license = { text = "Apache 2.0" }
readme = "README.rst"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"requests",
"aiohttp>=3.8.1,<4",
"click",
"pytz",
"arrow",
"python-rapidjson",
]

[project.optional-dependencies]
notebook = ["pandas"]
dev = [
"coverage",
"pytest",
"pytest-cov",
"mypy",
"pytest-asyncio",
"aioresponses",
"pytest-datadir",
"pytest-benchmark",
"pytest-monkeytype",
"pandas",
"types-pytz",
"types-setuptools",
"ruff",
]

[project.urls]
Homepage = "https://github.com/geotab/mygeotab-python"
Repository = "https://github.com/geotab/mygeotab-python"

[project.scripts]
myg = "mygeotab.cli:main"

[tool.setuptools]
include-package-data = true

[tool.setuptools.dynamic]
version = {attr = "mygeotab.__version__"}

[tool.setuptools.packages.find]
include = ["mygeotab*"]

[tool.setuptools.package-data]
"*" = ["LICENSE"]

[tool.ruff]
line-length = 127
target-version = "py37"
Expand All @@ -15,4 +88,22 @@ indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = false
docstring-code-line-length = "dynamic"
docstring-code-line-length = "dynamic"

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]

[tool.coverage.run]
source = ["mygeotab"]
omit = ["tests/*", "setup.py"]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
]
74 changes: 0 additions & 74 deletions setup.py

This file was deleted.

2 changes: 0 additions & 2 deletions tests/test_api_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
USERNAME = os.environ.get("MYGEOTAB_USERNAME_ASYNC", USERNAME)
PASSWORD = os.environ.get("MYGEOTAB_PASSWORD_ASYNC", PASSWORD)

pytestmark = pytest.mark.skipif(sys.version_info < (3, 7), reason="Only testing API on Python 3.7")


@pytest.fixture(scope="session")
def async_populated_api():
Expand Down
Loading