Skip to content

Commit

Permalink
Update base.py to remove setuptools and use standard library (#694)
Browse files Browse the repository at this point in the history
* Update base.py to remove setuptools and use standard library

* Update version to version number

* Update readme to remove pip install setuptools
  • Loading branch information
justinpolygon authored Jul 1, 2024
1 parent b47b852 commit 71bc469
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ Welcome to the official Python client library for the [Polygon](https://polygon.

## Prerequisites

Before installing the Polygon Python client, ensure your environment has Python 3.8 or higher. While most Python environments come with setuptools installed, it is a dependency for this library. In the rare case it's not already present, you can install setuptools using pip:

```
pip install setuptools
```
Before installing the Polygon Python client, ensure your environment has Python 3.8 or higher.

## Install

Expand Down
10 changes: 5 additions & 5 deletions polygon/rest/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
from enum import Enum
from typing import Optional, Any, Dict
from datetime import datetime
import pkg_resources # part of setuptools
from importlib.metadata import version, PackageNotFoundError
from .models.request import RequestOptionBuilder
from ..logging import get_logger
import logging
from urllib.parse import urlencode
from ..exceptions import AuthError, BadResponse

logger = get_logger("RESTClient")
version = "unknown"
version_number = "unknown"
try:
version = pkg_resources.require("polygon-api-client")[0].version
except:
version_number = version("polygon-api-client")
except PackageNotFoundError:
pass


Expand Down Expand Up @@ -46,7 +46,7 @@ def __init__(
self.headers = {
"Authorization": "Bearer " + self.API_KEY,
"Accept-Encoding": "gzip",
"User-Agent": f"Polygon.io PythonClient/{version}",
"User-Agent": f"Polygon.io PythonClient/{version_number}",
}

# initialize self.retries with the parameter value before using it
Expand Down

0 comments on commit 71bc469

Please sign in to comment.