Skip to content
Open
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
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,24 @@ pip install git+https://github.com/WFP-VAM/DataBridgesAPI.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/WFP-VAM/DataBridgesAPI.git`)

For local development, install from the project metadata in `pyproject.toml`:

```sh
pip install .
```

Then import the package:
```python
import data_bridges_client
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
The package metadata is declared in `pyproject.toml`. `setup.py` remains only as a compatibility wrapper for older tooling.

```sh
python setup.py install --user
pip install .
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
Expand Down Expand Up @@ -281,4 +286,3 @@ Authentication schemes defined for the API:

wfp.economicanalysis@wfp.org


84 changes: 38 additions & 46 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,50 @@
[tool.poetry]
name = "data_bridges_client"
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

[project]
name = "data-bridges-client"
version = "7.0.0"
description = "VAM-Data-Bridges"
authors = ["VAM-INFO <wfp.economicanalysis@wfp.org>"]
license = "Affero GPL 3.0"
readme = "README.md"
repository = "https://github.com/WFP-VAM/DataBridgesAPI"
requires-python = ">=3.10"
license = { text = "Affero GPL 3.0" }
authors = [
{ name = "VAM-INFO", email = "wfp.economicanalysis@wfp.org" },
]
keywords = ["OpenAPI", "OpenAPI-Generator", "VAM-Data-Bridges"]
include = ["data_bridges_client/py.typed"]
dependencies = [
"urllib3 >= 1.25.3, < 2.1.0",
"python-dateutil >= 2.8.2",
"pydantic >= 2",
"typing-extensions >= 4.7.1",
"httpx >= 0.23",
]

[tool.poetry.dependencies]
python = "^3.10"
[project.optional-dependencies]
test = [
"pytest~=7.1.3",
"pytest-cov>=2.8.1",
"pytest-randomly>=3.12.0",
]
dev = [
"pytest>=7.2.1",
"tox>=3.9.0",
"flake8>=4.0.0",
"types-python-dateutil>=2.8.19.14",
"mypy==1.4.1",
]

urllib3 = ">= 1.25.3"
python-dateutil = ">=2.8.2"
pydantic = ">=2"
typing-extensions = ">=4.7.1"
httpx = ">=0.23"
[project.urls]
Repository = "https://github.com/WFP-VAM/DataBridgesAPI"

[tool.poetry.dev-dependencies]
pytest = ">=7.2.1"
tox = ">=3.9.0"
flake8 = ">=4.0.0"
types-python-dateutil = ">=2.8.19.14"
mypy = "1.4.1"
[tool.setuptools.packages.find]
exclude = ["test", "tests"]

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

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.pylint.'MESSAGES CONTROL']
[tool.pylint."MESSAGES CONTROL"]
extension-pkg-whitelist = "pydantic"

[tool.mypy]
Expand All @@ -39,34 +53,12 @@ files = [
"test", # auto-generated tests
# "tests", # hand-written tests
]
# TODO: enable "strict" once all these individual checks are passing
# strict = true

# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true

## Getting these passing should be easy
strict_equality = true
strict_concatenate = true

## Strongly recommend enabling this one as soon as you can
check_untyped_defs = true

## These shouldn't be too much additional work, but may be tricky to
## get passing if you use a lot of untyped libraries
disallow_subclassing_any = true
disallow_untyped_decorators = true
disallow_any_generics = true

### These next few are various gradations of forcing use of type annotations
#disallow_untyped_calls = true
#disallow_incomplete_defs = true
#disallow_untyped_defs = true
#
### This one isn't too hard to get passing, but return on investment is lower
#no_implicit_reexport = true
#
### This one can be tricky to get passing if you use a lot of untyped libraries
#warn_return_any = true
9 changes: 3 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.25.3, < 2.1.0
pydantic >= 2
typing-extensions >= 4.7.1
httpx >= 0.23
# Deprecated compatibility shim.
# Runtime dependencies are declared in pyproject.toml.
.
51 changes: 2 additions & 49 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,51 +1,4 @@
# coding: utf-8
from setuptools import setup

"""
VAM-Data-Bridges

API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId=cbd1e508-c6e8-459d-96b7-6cac3039c42c&tenantId=462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern

The version of the OpenAPI document: 7.0.0
Contact: wfp.economicanalysis@wfp.org
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


from setuptools import setup, find_packages # noqa: H301

# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "data-bridges-client"
VERSION = "7.0.0"
PYTHON_REQUIRES = ">=3.10"
REQUIRES = [
"urllib3 >= 1.25.3, < 2.1.0",
"python-dateutil",
"pydantic >= 2",
"typing-extensions >= 4.7.1",
"httpx >= 0.23",
]

setup(
name=NAME,
version=VERSION,
description="VAM-Data-Bridges",
author="VAM-INFO",
author_email="wfp.economicanalysis@wfp.org",
url="",
keywords=["OpenAPI", "OpenAPI-Generator", "VAM-Data-Bridges"],
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
long_description_content_type='text/markdown',
long_description="""\
API Documentation of the **DataBridges** platform: https://databridges.vam.wfp.org/. For API discussions and details: #api-integration-vam-data-bridges on Slack, [Teams channel](https://teams.microsoft.com/l/team/19%3a4ca595f7681f4ffa8a86b7af58832e8d%40thread.skype/conversations?groupId&#x3D;cbd1e508-c6e8-459d-96b7-6cac3039c42c&amp;tenantId&#x3D;462ad9ae-d7d9-4206-b874-71b1e079776f) **API Integration** - This endpoint uses [Hey Jude](https://docs.api.wfp.org/providers/#api-patterns) pattern
""", # noqa: E501
package_data={"data_bridges_client": ["py.typed"]},
)
setup()
8 changes: 3 additions & 5 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pytest~=7.1.3
pytest-cov>=2.8.1
pytest-randomly>=3.12.0
mypy>=1.4.1
types-python-dateutil>=2.8.19
# Deprecated compatibility shim.
# Test dependencies are declared in pyproject.toml under [project.optional-dependencies].
.[test]
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
envlist = py3

[testenv]
deps=-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
extras = test

commands=
pytest --cov=data_bridges_client
Loading