Skip to content

Commit 1a70cef

Browse files
authored
Merge pull request #8 from currentslab/agent/release-readiness-0.1.0
chore(release): prepare 0.1.0 release
2 parents 6b32f00 + a4e33e7 commit 1a70cef

4 files changed

Lines changed: 46 additions & 13 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
- Aligned `search()` parameters with the current documented API surface.
1313
- Modernized packaging metadata: updated repository URL, classifiers, and dependency pins.
1414
- Unified package version to `0.1.0` across `setup.py` and `currentsapi/__init__.py`.
15+
- Single-sourced the version: `setup.py` now reads `__version__` from
16+
`currentsapi/__init__.py` instead of duplicating it.
17+
- Replaced the deprecated `tests_require` argument with an `extras_require`
18+
`"dev"` extra (`pip install currentsapi[dev]`).
19+
- Removed obsolete `setup.cfg`: the `description-file` metadata key is
20+
deprecated and the `universal` wheel flag is incorrect for a Python 3-only
21+
package.
22+
- README now clarifies that the PyPI distribution name is `currentsapi`
23+
(matching the 0.0.1/0.0.2 releases), documents `CurrentsAPIError` handling,
24+
and states the supported Python versions.
1525
- Updated README with current docs link and usage examples.
1626

1727
### Fixed

‎README.md‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ The official Python SDK for the [Currents API](https://currentsapi.services/en/d
44

55
## Installation
66

7-
Install the package from PyPI:
7+
Install the package from PyPI. The distribution name is `currentsapi` (this
8+
repository is `currentsapi-python`, and the Python import name is also
9+
`currentsapi`):
810

911
```bash
1012
pip install currentsapi
1113
```
1214

15+
Python 3.8+ is supported.
16+
1317
## Usage
1418

1519
Import the client and initialize it with your API key:
@@ -76,3 +80,17 @@ Get your API key at [https://currentsapi.services/en/register](https://currentsa
7680
## License
7781

7882
MIT License
83+
84+
## Error handling
85+
86+
Any non-200 API response raises `CurrentsAPIError`, which exposes the parsed
87+
response body:
88+
89+
```python
90+
from currentsapi.client import CurrentsAPIError
91+
92+
try:
93+
api.latest_news()
94+
except CurrentsAPIError as exc:
95+
print(exc.status, exc.code, exc.message)
96+
```

‎setup.cfg‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎setup.py‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
#!/usr/bin/env python
22

3+
import re
4+
from pathlib import Path
5+
36
from setuptools import setup, find_packages
47

5-
with open("README.md", "r") as fh:
8+
ROOT = Path(__file__).parent
9+
10+
with (ROOT / "README.md").open(encoding="utf-8") as fh:
611
long_description = fh.read()
712

13+
with (ROOT / "currentsapi" / "__init__.py").open(encoding="utf-8") as fh:
14+
version = re.search(r'^__version__ = "(.*?)"$', fh.read(), re.MULTILINE).group(1)
15+
16+
extras_require = {
17+
"dev": [
18+
"pytest",
19+
],
20+
}
21+
822
install_requires = [
923
"requests>=2.25.0",
1024
"python-dateutil>=2.8.0",
1125
]
1226

13-
tests_require = [
14-
"pytest",
15-
]
16-
1727
setup(
1828
name="currentsapi",
19-
version="0.1.0",
29+
version=version,
2030
author="Currents Dev",
2131
author_email="ray@currentsapi.services",
2232
license="MIT",
@@ -25,7 +35,7 @@
2535
long_description=long_description,
2636
long_description_content_type="text/markdown",
2737
install_requires=install_requires,
28-
tests_require=tests_require,
38+
extras_require=extras_require,
2939
description="Official Python client for the Currents API",
3040
keywords=["currentsapi", "news", "wrapper", "currents", "api"],
3141
classifiers=[

0 commit comments

Comments
 (0)