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
27 changes: 13 additions & 14 deletions .github/workflows/cd_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ name: Release Python Package to pypi
on:
push:
tags:
- 'v*'
- "v*"

jobs:
publish:

runs-on: ubuntu-latest

environment:
Expand All @@ -18,19 +17,19 @@ jobs:
id-token: write

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

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set up Python
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

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

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish package
run: uv publish
17 changes: 10 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["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

- 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 }}
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"]
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.10"
dependencies = [
"requests>=2.18.4",
"cachetools==4.2.0",
"aiohttp>=3.12.14,<=4",
]

[project.urls]
Homepage = "https://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",
]
12 changes: 0 additions & 12 deletions requirements.in

This file was deleted.

88 changes: 0 additions & 88 deletions requirements.txt

This file was deleted.

26 changes: 0 additions & 26 deletions setup.py

This file was deleted.

Loading