Skip to content

Commit

Permalink
fix(metahook): do not modify dict while looping over it
Browse files Browse the repository at this point in the history
  • Loading branch information
machow committed Jan 19, 2022
1 parent cf540e4 commit 2af4f11
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ jobs:
requirements: ['-r requirements.txt']
include:
# historical requirements
- name: "Minimum install_requires versions"
requirements: numpy~=1.12.0 pandas~=0.24.0 SQLAlchemy~=1.2.19 psycopg2~=2.7.0 PyMySQL==1.0.2
pytest_flags: --ignore=siuba/dply/forcats.py siuba
python-version: 3.6
- name: "2019-late dependencies"
requirements: numpy==1.17.4 pandas==0.24.2 SQLAlchemy==1.2.19 psycopg2==2.8.4 PyMySQL==1.0.2
pytest_flags: --ignore=siuba/dply/forcats.py siuba
python-version: 3.6
- name: "2020-early dependencies"
requirements: numpy==1.17.4 pandas~=0.25.3 SQLAlchemy~=1.3.11 psycopg2~=2.8.4 PyMySQL==1.0.2
pytest_flags: --ignore=siuba/dply/forcats.py siuba
Expand All @@ -39,7 +31,11 @@ jobs:
latest: true
- name: "2022-early dependencies"
python-version: 3.8
requirements: numpy~=1.22.1 pandas~=1.3.0 SQLAlchemy~=1.4.29 psycopg2-binary~=2.9.3 PyMySQL==1.0.2
requirements: numpy~=1.22.0 pandas~=1.3.5 SQLAlchemy~=1.4.29 psycopg2-binary~=2.9.3 PyMySQL==1.0.2
latest: true
- name: "2022-early dependencies"
python-version: 3.10.1
requirements: numpy~=1.22.0 pandas~=1.3.5 SQLAlchemy~=1.4.29 psycopg2-binary~=2.9.3 PyMySQL==1.0.2
latest: true

steps:
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pytest==5.3.5
python-dateutil==2.8.1
pytz==2020.1
PyYAML==5.3.1
pyzmq==19.0.0
pyzmq==22.3.0
requests==2.24.0
scipy==1.5.2
six==1.14.0
Expand Down
10 changes: 5 additions & 5 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ jsonschema==3.2.0
jupyter-client==6.0.0
jupyter-core==4.6.3
more-itertools==8.2.0
nbformat==5.0.4
nbval==0.9.5
nbformat==5.1.3
nbval==0.9.6
packaging==20.3
parso==0.6.2
pexpect==4.8.0
pickleshare==0.7.5
pluggy==0.13.1
prompt-toolkit==3.0.3
ptyprocess==0.6.0
py==1.8.1
py==1.11.0
Pygments==2.5.2
pyparsing==2.4.6
pyrsistent==0.15.7
pytest==5.3.5
pytest==6.2.5
python-dateutil==2.8.1
pyzmq==19.0.0
pyzmq==22.3.0
six==1.14.0
sortedcontainers==2.1.0
tornado==6.0.4
Expand Down
10 changes: 9 additions & 1 deletion siuba/meta_hook.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
DEPRECATED.
Note that this module was experimental, and created very early in siuba's development.
You should not rely on it for anything important.
"""

from importlib.abc import Loader, MetaPathFinder
from importlib.machinery import ModuleSpec
from importlib.util import find_spec
Expand Down Expand Up @@ -55,7 +62,8 @@ def exec_module(self, module):
#self.orig_loader.exec_module(self.orig_module)

#for k,v in self.orig_module.__dict__.items():
for k,v in self.orig_module.__dict__.items():
all_items = list(self.orig_module.__dict__.items())
for k,v in all_items:
if k.startswith('_'):
module.__dict__[k] = v
else:
Expand Down

0 comments on commit 2af4f11

Please sign in to comment.