From b0d4d8efecb3221bebe3591d2b1a1b922e28ffd8 Mon Sep 17 00:00:00 2001 From: "Allen, Timothy" Date: Fri, 31 Jan 2025 09:40:58 -0500 Subject: [PATCH 1/2] Update supported Python versions. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fc272d5..5c79bab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,11 +20,11 @@ keywords = ["wrds", "finance", "research", "crsp", "compustat"] classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: End Users/Desktop", From 0322bf53893323f8d41e0ac57a3b32fdef3f55b7 Mon Sep 17 00:00:00 2001 From: "Allen, Timothy" Date: Fri, 31 Jan 2025 10:05:55 -0500 Subject: [PATCH 2/2] Remove un-used dependencies (scipy, numpy); let numpy cascade from pandas. Fix escaping issues. --- .gitignore | 1 + pyproject.toml | 4 +--- wrds/sql.py | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 65f0b83..9e01f7d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__ docs/build/ build/ dist/ +venv/ *egg-info* *.ipynb .ipynb_checkpoints diff --git a/pyproject.toml b/pyproject.toml index 5c79bab..2c75dec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,11 +36,9 @@ classifiers = [ "License :: OSI Approved :: BSD License", ] dependencies = [ - "numpy>=1.26,<1.27", - "packaging<23.3", + "packaging<=24.2", "pandas>=2.2,<2.3", "psycopg2-binary>=2.9,<2.10", - "scipy>=1.12,<1.13", "sqlalchemy>=2,<2.1", ] dynamic = ["version"] diff --git a/wrds/sql.py b/wrds/sql.py index fdb70aa..1605099 100644 --- a/wrds/sql.py +++ b/wrds/sql.py @@ -219,7 +219,7 @@ def __get_user_credentials(self): return username, passwd def create_pgpass_file(self): - """ + r""" Create a .pgpass file to store WRDS connection credentials. Use the existing username and password if already connected to WRDS, @@ -245,7 +245,7 @@ def create_pgpass_file(self): self.__create_pgpass_file_unix() def __create_pgpass_file_win32(self): - """ + r""" Create a pgpass.conf file on Windows. Windows is different enough from everything else @@ -294,7 +294,7 @@ def __write_pgpass_file(self, pgfile): """ pgpass = "{host}:{port}:{dbname}:{user}:{passwd}\n" passwd = self._password - passwd = passwd.replace(":", "\:") + passwd = passwd.replace(":", r"\:") # Avoid clobbering the file if it exists if os.path.isfile(pgfile): with open(pgfile, "r") as fd: @@ -305,7 +305,7 @@ def __write_pgpass_file(self, pgfile): # split() from splitting on them. # Saving to a new variable here absolves us # of having to re-replace the substituted ##COLON## later. - oldline = line.replace("""\:""", "##COLON##") + oldline = line.replace(r"\:", "##COLON##") fields = oldline.split(":") # On finding a line matching the hostname, port and dbname # we replace it with the new pgpass line.