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
19 changes: 12 additions & 7 deletions .github/workflows/cd_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,23 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: '3.10'

- name: Install dependencies
run: pip install -r requirements.txt

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.7"
enable-cache: true
cache-dependency-glob: "uv.lock"


- name: Build package
run: python setup.py sdist bdist_wheel
run: uv build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
run: uv publish
21 changes: 14 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.7"
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
run: uv sync --all-groups

- name: Run tests
run: pytest
run: uv run pytest
env:
IPINFO_TOKEN: ${{ secrets.IPINFO_TOKEN }}
IPINFO_TOKEN: ${{ secrets.IPINFO_TOKEN }}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ target/
# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
2 changes: 1 addition & 1 deletion ipinfo/handler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import sys

from .version import SDK_VERSION
from .version import __version__ as SDK_VERSION

# Base URL to make requests against.
API_URL = "https://ipinfo.io"
Expand Down
2 changes: 1 addition & 1 deletion ipinfo/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SDK_VERSION = "5.4.1"
__version__ = "5.4.1"
36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[project]
name = "ipinfo"
dynamic = ["version"] # Use this if you want to keep SDK_VERSION in a python file
description = "Official Python library for IPInfo"
readme = "README.md"
authors = [
{ name = "IPinfo", email = "support@ipinfo.io" }
]
license = { text = "Apache License 2.0" }
requires-python = ">=3.9"
dependencies = [
"requests>=2.18.4",
"cachetools==4.2.0",
"aiohttp>=3.12.14,<=4",
]

[project.urls]
Homepage = "http://github.com/ipinfo/python"
Documentation = "https://ipinfo.io/developers"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "ipinfo/version.py"

[tool.hatch.build.targets.wheel]
packages = ["ipinfo"]

[dependency-groups]
dev = [
"pytest==8.4.1",
"pytest-asyncio==1.1.0",
"black==22.6.0",
]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

from ipinfo.version import SDK_VERSION
from ipinfo.version import __version__ as SDK_VERSION

long_description = """
The official Python library for IPinfo.
Expand Down
1,212 changes: 1,212 additions & 0 deletions uv.lock

Large diffs are not rendered by default.