Skip to content

Commit

Permalink
misc auto_schema changes (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto authored Aug 25, 2023
1 parent 119f5fc commit 63fe90f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 53 deletions.
8 changes: 5 additions & 3 deletions python/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ verify_ssl = true

[dev-packages]
pytest = "*"
autopep8 = ""

[packages]
alembic = "==1.11.1"
#alembic = "==1.12.0"
# use a fork until alembic 1.12.0 is released and can use that
# needed for ruff support
lolopinto-alembic-fork = "==0.0.1.dev0"
datetime = "==4.3"
sqlalchemy = "==2.0.18"
psycopg2 = "==2.9.6"
autopep8 = "==2.0.2"
ruff = "==0.0.285"
python-dateutil= "==2.8.2"

[requires]
Expand Down
73 changes: 32 additions & 41 deletions python/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion python/auto_schema/RELEASING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ Steps to release new version:
* Bump version in `setup.py`
* Run the following command from `python/auto_schema` (where `setup.py` is located): `python3 setup.py sdist bdist_wheel`.
* Run `python3 -m twine upload --repository pypi dist/*` to upload to pypi OR `python3 -m twine upload --repository testpypi dist/*`. You need to be added to the project and have a [token](https://pypi.org/help/#apitoken) (or [test token](https://test.pypi.org/help/#apitoken)) in `~/.pypirc` or equivalent location.
* Recommend cleaning up after by running `rm -rf dist/`
* Recommend cleaning up after by running the following:

1. `rm -rf dist/`
2. `rm -rf auto_schema.egg-info`
3. `rm -rf auto_schema_test.egg-info`

## Testing

Expand Down
8 changes: 4 additions & 4 deletions python/auto_schema/auto_schema/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ def __init__(self, connection, schema_path):
"alembic:exclude", "tables", runner.Runner.exclude_tables())

# for default formatting
alembic_cfg.set_section_option('post_write_hooks', 'hooks', 'autopep8')
alembic_cfg.set_section_option('post_write_hooks', 'hooks', 'ruff')
alembic_cfg.set_section_option(
'post_write_hooks', 'autopep8.type', 'console_scripts')
'post_write_hooks', 'ruff.type', 'exec')
alembic_cfg.set_section_option(
'post_write_hooks', 'autopep8.entrypoint', 'autopep8')
'post_write_hooks', 'ruff.executable', 'ruff')
alembic_cfg.set_section_option(
'post_write_hooks', 'autopep8.options', '--in-place')
'post_write_hooks', 'ruff.options', '--fix REVISION_SCRIPT_FILENAME --silent')

self.alembic_cfg = alembic_cfg

Expand Down
2 changes: 1 addition & 1 deletion python/auto_schema/auto_schema/script.py.mako
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Revises: ${down_revision | comma,n}
Create Date: ${create_date}

"""
from alembic import op
from alembic import op #noqa
import sqlalchemy as sa
import auto_schema
## TODO: for down commands when removing edges, we add "UUID()" which is broken and unncessary :(
Expand Down
Empty file.
7 changes: 4 additions & 3 deletions python/auto_schema/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
setuptools.setup(
name="auto_schema_test", # auto_schema_test to test
# 0.0.29 production
version="0.0.28", # 0.0.26 was last test version
version="0.0.32", # 0.0.26 was last test version
author="Ola Okelola",
author_email="[email protected]",
description="auto schema for a db",
Expand All @@ -23,10 +23,11 @@
],
python_requires='==3.11',
install_requires=["sqlalchemy==2.0.18",
"alembic==1.11.1",
# "alembic @ git+https://github.com/sqlalchemy/alembic.git@dbdec2661b8a01132ea3f7a027f85fed2eaf5e54#egg=alembic",
"lolopinto-alembic-fork==0.0.1.dev0",
"datetime==4.3",
"psycopg2==2.9.6",
"autopep8==2.0.2",
"ruff==0.0.285",
"python-dateutil==2.8.2"
],
entry_points={'console_scripts': ["auto_schema = auto_schema.cli:main"]},
Expand Down

0 comments on commit 63fe90f

Please sign in to comment.