diff --git a/HISTORY.md b/HISTORY.md index dfc6a74d..6c461633 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -4,6 +4,16 @@ In the beginning, programmers created the databases. Now the databases were form And so [Salesforce.org](http://salesforce.org/) said “Let there be data,” and there was Snowfakery. And it was good. +## Snowfakery 3.6.0 + +Added educational and non-profit fakers (#897) + +Better error messages for missing database drivers. (#873) + +Improve error message for random_record query into Salesforce org. (#844) + +Simpler syntax for choice feature. (#441) + ## Snowfakery 3.5.0 Snowfakery's Debug and CSV outputs now use the same format that Salesforce prefers. (#778) diff --git a/requirements/dev.in b/requirements/dev.in index 9044ee4f..d72d8037 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -6,7 +6,6 @@ diff-cover mkdocs<1.3.0 # need to change Snowfakery monkey-patching before upgrade mkdocs-exclude-search pre-commit -pyright pytest pytest-cov faker-microservice diff --git a/requirements/dev.txt b/requirements/dev.txt index 7c7b6232..4439557f 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -5,26 +5,28 @@ # pip-compile --allow-unsafe requirements/dev.in # attrs==23.1.0 - # via jsonschema -black==23.3.0 + # via + # jsonschema + # referencing +black==23.7.0 # via -r requirements/dev.in -cachetools==5.3.0 +cachetools==5.3.1 # via tox -certifi==2022.12.7 +certifi==2023.7.22 # via # -r requirements/prod.txt # requests -cfgv==3.3.1 +cfgv==3.4.0 # via pre-commit -chardet==5.1.0 +chardet==5.2.0 # via # diff-cover # tox -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 # via # -r requirements/prod.txt # requests -click==8.1.3 +click==8.1.6 # via # -r requirements/prod.txt # black @@ -38,15 +40,15 @@ coverage[toml]==6.5.0 # pytest-cov coveralls==3.3.1 # via -r requirements/dev.in -diff-cover==7.5.0 +diff-cover==7.7.0 # via -r requirements/dev.in -distlib==0.3.6 +distlib==0.3.7 # via virtualenv docopt==0.6.2 # via coveralls -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via pytest -faker==18.7.0 +faker==19.3.0 # via # -r requirements/prod.txt # faker-edu @@ -58,26 +60,22 @@ faker-microservice==2.0.0 # via -r requirements/dev.in faker-nonprofit==1.0.0 # via -r requirements/prod.txt -filelock==3.12.0 +filelock==3.12.2 # via # tox # virtualenv ghp-import==2.1.0 # via mkdocs -greenlet==2.0.2 - # via - # -r requirements/prod.txt - # sqlalchemy gvgen==1.0 # via -r requirements/prod.txt -identify==2.5.23 +identify==2.5.26 # via pre-commit idna==3.4 # via # -r requirements/prod.txt # requests # yarl -importlib-metadata==6.6.0 +importlib-metadata==6.8.0 # via # markdown # mkdocs @@ -88,11 +86,13 @@ jinja2==3.1.2 # -r requirements/prod.txt # diff-cover # mkdocs -jsonschema==4.17.3 +jsonschema==4.19.0 # via -r requirements/dev.in -markdown==3.4.3 +jsonschema-specifications==2023.7.1 + # via jsonschema +markdown==3.4.4 # via mkdocs -markupsafe==2.1.2 +markupsafe==2.1.3 # via # -r requirements/prod.txt # jinja2 @@ -108,7 +108,7 @@ multidict==6.0.4 # via yarl mypy-extensions==1.0.0 # via black -nodeenv==1.7.0 +nodeenv==1.8.0 # via # pre-commit # pyright @@ -119,36 +119,34 @@ packaging==23.1 # pyproject-api # pytest # tox -pathspec==0.11.1 +pathspec==0.11.2 # via black -platformdirs==3.5.0 +platformdirs==3.10.0 # via # black # tox # virtualenv -pluggy==1.0.0 +pluggy==1.2.0 # via # diff-cover # pytest # tox -pre-commit==3.3.1 +pre-commit==3.3.3 # via -r requirements/dev.in -pydantic==1.10.7 +pydantic==1.10.12 # via -r requirements/prod.txt -pygments==2.15.1 +pygments==2.16.1 # via diff-cover -pyproject-api==1.5.1 +pyproject-api==1.5.3 # via tox -pyright==1.1.305 +pyright==1.1.322 # via -r requirements/dev.in -pyrsistent==0.19.3 - # via jsonschema -pytest==7.3.1 +pytest==7.4.0 # via # -r requirements/dev.in # pytest-cov # pytest-vcr -pytest-cov==4.0.0 +pytest-cov==4.1.0 # via -r requirements/dev.in pytest-vcr==1.0.2 # via -r requirements/dev.in @@ -159,7 +157,7 @@ python-dateutil==2.8.2 # -r requirements/prod.txt # faker # ghp-import -pyyaml==6.0 +pyyaml==6.0.1 # via # -r requirements/prod.txt # mkdocs @@ -169,6 +167,10 @@ pyyaml==6.0 # vcrpy pyyaml-env-tag==0.1 # via mkdocs +referencing==0.30.2 + # via + # jsonschema + # jsonschema-specifications requests==2.29.0 # via # -r requirements/prod.txt @@ -176,12 +178,15 @@ requests==2.29.0 # responses responses==0.23.1 # via -r requirements/dev.in +rpds-py==0.9.2 + # via + # jsonschema + # referencing six==1.16.0 # via # -r requirements/prod.txt # python-dateutil - # vcrpy -sqlalchemy==1.4.48 +sqlalchemy==1.4.49 # via -r requirements/prod.txt tomli==2.0.1 # via @@ -190,29 +195,30 @@ tomli==2.0.1 # pyproject-api # pytest # tox -tox==4.5.1 +tox==4.8.0 # via # -r requirements/dev.in # tox-gh-actions -tox-gh-actions==3.1.0 +tox-gh-actions==3.1.3 # via -r requirements/dev.in -types-pyyaml==6.0.12.9 +types-pyyaml==6.0.12.11 # via responses -typing-extensions==4.5.0 +typing-extensions==4.7.1 # via # -r requirements/prod.txt # black # pydantic -urllib3==1.26.15 +urllib3==1.26.16 # via # -r requirements/prod.txt # requests # responses -vcrpy==4.2.1 + # vcrpy +vcrpy==5.1.0 # via # -r requirements/dev.in # pytest-vcr -virtualenv==20.23.0 +virtualenv==20.24.3 # via # pre-commit # tox @@ -222,9 +228,9 @@ wrapt==1.15.0 # via vcrpy yarl==1.9.2 # via vcrpy -zipp==3.15.0 +zipp==3.16.2 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: -setuptools==67.7.2 +setuptools==68.0.0 # via nodeenv diff --git a/requirements/prod.in b/requirements/prod.in index 4aaafa92..26e6777d 100644 --- a/requirements/prod.in +++ b/requirements/prod.in @@ -7,6 +7,6 @@ PyYAML click python-dateutil gvgen -pydantic +pydantic<2.0.0 python-baseconv -requests +requests<=2.29.0 # There are issues with urllib on latest version diff --git a/requirements/prod.txt b/requirements/prod.txt index 02591100..6fc53bca 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -4,13 +4,13 @@ # # pip-compile --allow-unsafe requirements/prod.in # -certifi==2022.12.7 +certifi==2023.7.22 # via requests -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 # via requests -click==8.1.3 +click==8.1.6 # via -r requirements/prod.in -faker==18.7.0 +faker==19.3.0 # via # -r requirements/prod.in # faker-edu @@ -19,17 +19,15 @@ faker-edu==1.0.0 # via -r requirements/prod.in faker-nonprofit==1.0.0 # via -r requirements/prod.in -greenlet==2.0.2 - # via sqlalchemy gvgen==1.0 # via -r requirements/prod.in idna==3.4 # via requests jinja2==3.1.2 # via -r requirements/prod.in -markupsafe==2.1.2 +markupsafe==2.1.3 # via jinja2 -pydantic==1.10.7 +pydantic==1.10.12 # via -r requirements/prod.in python-baseconv==1.2.2 # via -r requirements/prod.in @@ -37,15 +35,15 @@ python-dateutil==2.8.2 # via # -r requirements/prod.in # faker -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/prod.in requests==2.29.0 # via -r requirements/prod.in six==1.16.0 # via python-dateutil -sqlalchemy==1.4.48 +sqlalchemy==1.4.49 # via -r requirements/prod.in -typing-extensions==4.5.0 +typing-extensions==4.7.1 # via pydantic -urllib3==1.26.15 +urllib3==1.26.16 # via requests diff --git a/snowfakery/salesforce.py b/snowfakery/salesforce.py index ffd419cc..639397e8 100644 --- a/snowfakery/salesforce.py +++ b/snowfakery/salesforce.py @@ -11,8 +11,8 @@ def create_cci_record_type_tables(db_url: str): engine = create_engine(db_url) metadata = MetaData() metadata.reflect(views=True, bind=engine) - with engine.connect() as connection, connection.begin(): - for tablename, table in list(metadata.tables.items()): + with engine.connect() as connection, connection.begin(): # type: ignore + for tablename, table in list(metadata.tables.items()): # type: ignore record_type_column = find_record_type_column( tablename, table.columns.keys() ) @@ -37,12 +37,12 @@ def _populate_rt_table( ): column = getattr(table.columns, columnname) query_res = connection.execute(select(column).where(column is not None).distinct()) - record_types = [res[0] for res in query_res if res[0]] + record_types = [res[0] for res in query_res if res[0]] # type: ignore if record_types: insert_stmt = rt_table.insert() rows = [ - dict(zip(rt_table.columns.keys(), (rtname, rtname))) + dict(zip(rt_table.columns.keys(), (rtname, rtname))) # type: ignore for rtname in record_types ] diff --git a/snowfakery/tools/mkdocs.py b/snowfakery/tools/mkdocs.py index fd7edea2..a82ac31f 100644 --- a/snowfakery/tools/mkdocs.py +++ b/snowfakery/tools/mkdocs.py @@ -9,7 +9,7 @@ class Plugin(BasePlugin): config_scheme = ( - ("build_locales", mkdocs.config.config_options.Type(bool, default=False)), + ("build_locales", mkdocs.config.config_options.Type(bool, default=False)), # type: ignore ) def on_config(self, config): diff --git a/snowfakery/tools/snowbench.py b/snowfakery/tools/snowbench.py index e720fda8..0c5fb762 100644 --- a/snowfakery/tools/snowbench.py +++ b/snowfakery/tools/snowbench.py @@ -129,7 +129,7 @@ def status(tempdir, num_records, num_records_tablename, progress_bar): start = time() sleep(2) previous_count = 0 - for i in range(1, 10 ** 20): + for i in range(1, 10**20): sleep(1) if i in (2, 5, 10, 20, 30, 45, 90, 150) or (i % 60 == 0): print() @@ -163,7 +163,7 @@ def count_database(filename, counts): dburl = f"sqlite:///{filename}?mode=ro" engine = create_engine(dburl) insp = inspect(engine) - tables = insp.get_table_names() + tables = insp.get_table_names() # type: ignore for table in tables: counts[table] += count_table(engine, table) return counts diff --git a/snowfakery/version.txt b/snowfakery/version.txt index 1545d966..40c341bd 100644 --- a/snowfakery/version.txt +++ b/snowfakery/version.txt @@ -1 +1 @@ -3.5.0 +3.6.0