Best way to resolve conflicts between application packages

I am developing a package that will be used by 3-party applications that I have no control over whatsoever.

I am wondering what is the best way to solve conflicts between packages.

For example:

Lets say a 3-party app wants to use my package called external-package.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>├── Dockerfile
├── app.py
├── external-package
│ ├── Core
│ │ ├── ClassA.py
│ │ └── __init__.py
│ └── setup.py
└── requirements.txt
</code>
<code>├── Dockerfile ├── app.py ├── external-package │ ├── Core │ │ ├── ClassA.py │ │ └── __init__.py │ └── setup.py └── requirements.txt </code>
├── Dockerfile
├── app.py
├── external-package
│   ├── Core
│   │   ├── ClassA.py
│   │   └── __init__.py
│   └── setup.py
└── requirements.txt

App.py:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>from Core import ClassA
app = ClassA()
app.send()
</code>
<code>from Core import ClassA app = ClassA() app.send() </code>
from Core import ClassA

app = ClassA()
app.send()

ClassA:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import backoff
import requests
class ClassA:
@backoff.on_exception(
backoff.expo,
requests.exceptions.RequestException,
max_tries=35,
backoff_log_level=20,
max_time=2400,
raise_on_giveup=True,
)
def send(self):
requests.get('https://google.com')
</code>
<code>import backoff import requests class ClassA: @backoff.on_exception( backoff.expo, requests.exceptions.RequestException, max_tries=35, backoff_log_level=20, max_time=2400, raise_on_giveup=True, ) def send(self): requests.get('https://google.com') </code>
import backoff
import requests

class ClassA:

    @backoff.on_exception(
        backoff.expo,
        requests.exceptions.RequestException,
        max_tries=35,
        backoff_log_level=20,
        max_time=2400,
        raise_on_giveup=True,
    )
    def send(self):
        requests.get('https://google.com')

Dockerfile:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>FROM python:3.10-slim-buster
RUN apt-get update && apt-get install -y
automake
build-essential
libtool
wget
--no-install-recommends &&
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY ./external-package /app/external-package
RUN pip install --no-cache-dir /app/external-package
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY . /app
CMD ["python", "app.py"]
</code>
<code>FROM python:3.10-slim-buster RUN apt-get update && apt-get install -y automake build-essential libtool wget --no-install-recommends && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY ./external-package /app/external-package RUN pip install --no-cache-dir /app/external-package COPY requirements.txt /app/requirements.txt RUN pip install --no-cache-dir -r /app/requirements.txt COPY . /app CMD ["python", "app.py"] </code>
FROM python:3.10-slim-buster

RUN apt-get update && apt-get install -y 
    automake 
    build-essential 
    libtool 
    wget 
    --no-install-recommends && 
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY ./external-package /app/external-package
RUN pip install --no-cache-dir /app/external-package

COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt

COPY . /app

CMD ["python", "app.py"]

Running this container will outputs an error:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Traceback (most recent call last):
File "/app/app.py", line 4, in <module>
app.send()
File "/usr/local/lib/python3.10/site-packages/backoff/_sync.py", line 87, in retry
wait = _init_wait_gen(wait_gen, wait_gen_kwargs)
File "/usr/local/lib/python3.10/site-packages/backoff/_common.py", line 23, in _init_wait_gen
return wait_gen(**kwargs)
TypeError: expo() got an unexpected keyword argument 'backoff_log_level'
</code>
<code>Traceback (most recent call last): File "/app/app.py", line 4, in <module> app.send() File "/usr/local/lib/python3.10/site-packages/backoff/_sync.py", line 87, in retry wait = _init_wait_gen(wait_gen, wait_gen_kwargs) File "/usr/local/lib/python3.10/site-packages/backoff/_common.py", line 23, in _init_wait_gen return wait_gen(**kwargs) TypeError: expo() got an unexpected keyword argument 'backoff_log_level' </code>
Traceback (most recent call last):
  File "/app/app.py", line 4, in <module>
    app.send()
  File "/usr/local/lib/python3.10/site-packages/backoff/_sync.py", line 87, in retry
    wait = _init_wait_gen(wait_gen, wait_gen_kwargs)
  File "/usr/local/lib/python3.10/site-packages/backoff/_common.py", line 23, in _init_wait_gen
    return wait_gen(**kwargs)
TypeError: expo() got an unexpected keyword argument 'backoff_log_level'

Because, the external-package must have backoff ==1.9.2, and the 3-party must have backoff ==2.2.1 but the container has backoff ==1.9.2.

Keep in mind this is an example only for backoff and I want a way to solve this issue for any library there is.

0

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật