diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04a29dd..f722a6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e90f62..3cc2260 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 5d36669..048ef39 100644 --- a/README.md +++ b/README.md @@ -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() @@ -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) @@ -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() diff --git a/ipware/__version__.py b/ipware/__version__.py deleted file mode 100644 index 68cdeee..0000000 --- a/ipware/__version__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "1.0.5" diff --git a/pyproject.toml b/pyproject.toml index afa4fa3..a0e6c4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ @@ -85,5 +85,5 @@ max-complexity = 16 [tool.coverage.run] omit = [ - "ipware/__version__.py" + "python_ipware/__version__.py" ] \ No newline at end of file diff --git a/ipware/__init__.py b/python_ipware/__init__.py similarity index 51% rename from ipware/__init__.py rename to python_ipware/__init__.py index e987461..5ec16c9 100644 --- a/ipware/__init__.py +++ b/python_ipware/__init__.py @@ -1,2 +1,2 @@ -from .ipware import IpWare # noqa +from .python_ipware import IpWare # noqa from .__version__ import __version__ # noqa diff --git a/python_ipware/__version__.py b/python_ipware/__version__.py new file mode 100644 index 0000000..8c0d5d5 --- /dev/null +++ b/python_ipware/__version__.py @@ -0,0 +1 @@ +__version__ = "2.0.0" diff --git a/ipware/py.typed b/python_ipware/py.typed similarity index 100% rename from ipware/py.typed rename to python_ipware/py.typed diff --git a/ipware/ipware.py b/python_ipware/python_ipware.py similarity index 100% rename from ipware/ipware.py rename to python_ipware/python_ipware.py diff --git a/tests/tests_ipv4.py b/tests/tests_ipv4.py index 7678b63..277c7c3 100644 --- a/tests/tests_ipv4.py +++ b/tests/tests_ipv4.py @@ -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 diff --git a/tests/tests_ipv6.py b/tests/tests_ipv6.py index e34d670..8017750 100644 --- a/tests/tests_ipv6.py +++ b/tests/tests_ipv6.py @@ -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