Skip to content

Commit 07840b9

Browse files
authored
Introduced breaking changes to avoid conflicts with the django-ipware package. (#11) (#12)
* rename ipware to python_ipware
1 parent af76d22 commit 07840b9

11 files changed

Lines changed: 20 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
python -m pip install --upgrade pip
3535
pip install -e .[dev]
3636
- name: Run ruff
37-
run: ruff --format=github .
37+
run: ruff .
3838
- name: Run test
39-
run: coverage run --source=ipware -m unittest discover
39+
run: coverage run --source=python_ipware -m unittest discover
4040
- name: Coveralls
4141
run: coveralls --service=github
4242
env:

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 2.0.0
2+
3+
- Introduced breaking changes to avoid conflicts with the `django-ipware` package.
4+
- Renamed the imported module from `ipware` to `python_ipware` in the `python-ipware` package.
5+
- Old usage: `from ipware import IpWare`
6+
- New usage: `from python_ipware import IpWare`
7+
18
## 1.0.5
29

310
- Enhance: Readme updates

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pip3 install python-ipware
4141
Here's a basic example of how to use `python-ipware` in a view or middleware where the `request` object is available. This can be applied in Django, Flask, or other similar frameworks.
4242

4343
```python
44-
from ipware import IpWare
44+
from python_ipware import IpWare
4545

4646
# Instantiate IpWare with default values
4747
ipw = IpWare()
@@ -186,7 +186,7 @@ You can customize the proxy count by providing your `proxy_count` during initial
186186

187187
```python
188188
# In the above scenario, the total number of proxies can be used as a way to filter out unwanted requests.
189-
from ipware import IpWare
189+
from python_ipware import IpWare
190190

191191
# enforce proxy count
192192
ipw = IpWare(proxy_count=1)
@@ -219,7 +219,7 @@ In the following `example`, your public load balancer (LB) can be seen as the `o
219219
```python
220220
# We make best attempt to return the first public IP address based on header precedence
221221
# Then we fall back on private, followed by loopback
222-
from ipware import IpWare
222+
from python_ipware import IpWare
223223

224224
# no proxy enforce in this example
225225
ipw = IpWare()

ipware/__version__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ dev = [
4343
]
4444

4545
[tool.setuptools]
46-
packages = ["ipware"]
46+
packages = ["python_ipware"]
4747

4848
[tool.setuptools.dynamic]
49-
version = {attr = "ipware.__version__"}
49+
version = {attr = "python_ipware.__version__"}
5050
readme = {file = ["README.md"], content-type = "text/markdown"}
5151

5252
[tool.setuptools.package-data]
53-
"ipware" = ["py.typed"]
53+
"python_ipware" = ["py.typed"]
5454

5555
[tool.ruff]
5656
select = [
@@ -85,5 +85,5 @@ max-complexity = 16
8585

8686
[tool.coverage.run]
8787
omit = [
88-
"ipware/__version__.py"
88+
"python_ipware/__version__.py"
8989
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
from .ipware import IpWare # noqa
1+
from .python_ipware import IpWare # noqa
22
from .__version__ import __version__ # noqa

python_ipware/__version__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "2.0.0"
File renamed without changes.

tests/tests_ipv4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22
import logging
33
from ipaddress import IPv4Address
4-
from ipware import IpWare
4+
from python_ipware import IpWare
55

66
logging.disable(logging.CRITICAL) # Disable logging for the entire file
77

0 commit comments

Comments
 (0)