Skip to content

Commit

Permalink
Introduced breaking changes to avoid conflicts with the `django-ipwar…
Browse files Browse the repository at this point in the history
…e` package. (#11) (#12)

* rename ipware to python_ipware
  • Loading branch information
un33k authored Oct 25, 2023
1 parent af76d22 commit 07840b9
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Run ruff
run: ruff --format=github .
run: ruff .
- name: Run test
run: coverage run --source=ipware -m unittest discover
run: coverage run --source=python_ipware -m unittest discover
- name: Coveralls
run: coveralls --service=github
env:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2.0.0

- Introduced breaking changes to avoid conflicts with the `django-ipware` package.
- Renamed the imported module from `ipware` to `python_ipware` in the `python-ipware` package.
- Old usage: `from ipware import IpWare`
- New usage: `from python_ipware import IpWare`

## 1.0.5

- Enhance: Readme updates
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pip3 install python-ipware
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.

```python
from ipware import IpWare
from python_ipware import IpWare

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

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

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

# no proxy enforce in this example
ipw = IpWare()
Expand Down
1 change: 0 additions & 1 deletion ipware/__version__.py

This file was deleted.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ dev = [
]

[tool.setuptools]
packages = ["ipware"]
packages = ["python_ipware"]

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

[tool.setuptools.package-data]
"ipware" = ["py.typed"]
"python_ipware" = ["py.typed"]

[tool.ruff]
select = [
Expand Down Expand Up @@ -85,5 +85,5 @@ max-complexity = 16

[tool.coverage.run]
omit = [
"ipware/__version__.py"
"python_ipware/__version__.py"
]
2 changes: 1 addition & 1 deletion ipware/__init__.py → python_ipware/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .ipware import IpWare # noqa
from .python_ipware import IpWare # noqa
from .__version__ import __version__ # noqa
1 change: 1 addition & 0 deletions python_ipware/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2.0.0"
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/tests_ipv4.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
import logging
from ipaddress import IPv4Address
from ipware import IpWare
from python_ipware import IpWare

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

Expand Down
2 changes: 1 addition & 1 deletion tests/tests_ipv6.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
from ipaddress import IPv4Address, IPv6Address

from ipware import IpWare
from python_ipware import IpWare

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

Expand Down

0 comments on commit 07840b9

Please sign in to comment.