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
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .[dev]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -50,10 +49,12 @@ jobs:
if: env.COVERAGE == 1
run: |
coverage run -m unittest tests/*.py
- name: Coverage
coverage xml
- name: Upload coverage to Codecov
env:
COVERAGE: ${{ matrix.coverage }}
if: env.COVERAGE == 1
run: |
bash <(curl -s https://codecov.io/bash)
rm .coverage coverage.xml
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
15 changes: 10 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"multidimensional-urlencode==0.0.4",
"nose==1.3.7",
"requests==2.32.4",
"coverage==4.5.4",
"pook==1.3.0",
"hatchling >= 1.26"
]

classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Other Environment",
Expand All @@ -39,7 +36,15 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
]
license = "MIT"
license-files = ["LICEN[CS]E*"]
license-files = ["LICENSE"]

[project.optional-dependencies]
dev = [
"nose==1.3.7",
"coverage==4.5.4",
"pook==1.3.0",
"flake8",
]

[project.urls]
Homepage = "https://github.com/retailcrm/api-client-python"
Expand Down
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

4 changes: 0 additions & 4 deletions setup.cfg

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

78 changes: 39 additions & 39 deletions tests/v5_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4085,45 +4085,45 @@ def test_offers(self):
"""

(pook.get(os.getenv('RETAILCRM_URL') + '/api/v5/store/offers')
.headers({'X-API-KEY': os.getenv('RETAILCRM_KEY')})
.params({'filter[site]': 'https://retailcrm.pro'})
.reply(200)
.headers(self.__header)
.json(
{
'success': 'true',
'pagination': {
'limit': 20,
'totalCount': 1,
'currentPage': 1,
'totalPageCount': 1
},
'offers': [
{
'images': [],
'id': 33937,
'site': 'https://retailcrm.pro',
'name': 'Shirt',
'article': 'SHIRT-BLACK',
'prices': {
"priceType": "base",
"price": 4,
"ordering": 100,
"currency": "EUR"
},
'purchasePrice': 1,
'vatRate': 'none',
'product': {},
'properties': {
'color': 'black'
},
'quantity': 10,
'active': True,
'barcode': '12345'
}
]
}
)
.headers({'X-API-KEY': os.getenv('RETAILCRM_KEY')})
.params({'filter[site]': 'https://retailcrm.pro'})
.reply(200)
.headers(self.__header)
.json(
{
'success': 'true',
'pagination': {
'limit': 20,
'totalCount': 1,
'currentPage': 1,
'totalPageCount': 1
},
'offers': [
{
'images': [],
'id': 33937,
'site': 'https://retailcrm.pro',
'name': 'Shirt',
'article': 'SHIRT-BLACK',
'prices': {
"priceType": "base",
"price": 4,
"ordering": 100,
"currency": "EUR"
},
'purchasePrice': 1,
'vatRate': 'none',
'product': {},
'properties': {
'color': 'black'
},
'quantity': 10,
'active': True,
'barcode': '12345'
}
]
}
)
)

response = self.client.offers({'site': 'https://retailcrm.pro'})
Expand Down