Skip to content

Commit 3dabe6b

Browse files
committed
ENH: make pip compatible
1 parent 47f2ccc commit 3dabe6b

File tree

5 files changed

+22
-137
lines changed

5 files changed

+22
-137
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Original work Copyright (c) Alex Gr�nholm
3+
Original work Copyright (c) Alex Gronholm
44
Modified work Copyright (c) Kamil Sindi
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
flask-sqlacodegen
22
=================
33

4-
Fork from <a href="https://pypi.python.org/pypi/sqlacodegen">sqlacodegen</a>. Based off of version 1.1.6.
4+
Fork of <a href="https://pypi.python.org/pypi/sqlacodegen">sqlacodegen</a>. Based off of version 1.1.6.
55

66
What's different:
77
* Support for Flask-SQLAlchemy syntax using `--flask` option. All this means:
@@ -13,3 +13,14 @@ What's different:
1313
* Generate explicit primary joins. I deal with pretty complicated tables that need explicit primary joins.
1414
* If column has a server_default set it to `FetchValue()` instead of trying to determine what that value is. Original code did not set the right server defaults in my set up.
1515
* `--ignore-cols` ignores special columns (e.g. id, inserted, updated) when generating association tables. Original code requires all columns to be foreign keys in order to generate association table. Example: `--ignore-cols id,inserted,updated`.
16+
17+
## Install
18+
19+
Note: planning to upload to pip. In the meantime, use the without pip option.
20+
21+
Without pip:
22+
```
23+
git clone https://github.com/ksindi/flask-sqlacodegen.git
24+
cd flask-sqlacodegen/
25+
python setup.py install
26+
```

README.rst

Lines changed: 0 additions & 122 deletions
This file was deleted.

setup.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import sys
2-
import os.path
32

43
from setuptools import setup, find_packages
54
from setuptools.command.test import test as TestCommand
@@ -23,17 +22,12 @@ def run_tests(self):
2322
if sys.version_info < (2, 7):
2423
extra_requirements = ('argparse',)
2524

26-
here = os.path.dirname(__file__)
27-
readme_path = os.path.join(here, 'README.rst')
28-
readme = open(readme_path).read()
29-
3025
setup(
31-
name='sqlacodegen',
32-
description='Automatic model code generator for SQLAlchemy',
33-
long_description=readme,
26+
name='flask-sqlacodegen',
27+
description='Automatic model code generator for SQLAlchemy with Flask support',
28+
long_description=open('README.md').read(),
3429
version=sqlacodegen.version,
3530
author='Kamil Sindi',
36-
author_email='kysindi@gmail.com',
3731
classifiers=[
3832
'Development Status :: 5 - Production/Stable',
3933
'Intended Audience :: Developers',
@@ -46,9 +40,11 @@ def run_tests(self):
4640
'Programming Language :: Python :: 2.7',
4741
'Programming Language :: Python :: 3',
4842
'Programming Language :: Python :: 3.2',
49-
'Programming Language :: Python :: 3.3'
43+
'Programming Language :: Python :: 3.3',
44+
'Programming Language :: Python :: 3.4',
45+
'Programming Language :: Python :: 3.5'
5046
],
51-
keywords='sqlalchemy',
47+
keywords=['sqlalchemy', 'flask-sqlacodegen', 'sqlacodegen'],
5248
license='MIT',
5349
packages=find_packages(exclude=['tests']),
5450
install_requires=(
@@ -60,7 +56,7 @@ def run_tests(self):
6056
zip_safe=False,
6157
entry_points={
6258
'console_scripts': [
63-
'sqlacodegen=sqlacodegen.main:main'
59+
'flask-sqlacodegen=sqlacodegen.main:main'
6460
]
6561
}
6662
)

sqlacodegen/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def main():
3636
parser.add_argument('--outfile', help='file to write output to (default: stdout)')
3737
parser.add_argument('--nobackrefs', action='store_true', help="don't include backrefs")
3838
parser.add_argument('--flask', action='store_true', help="use Flask-SQLAlchemy columns")
39-
parser.add_argument('--ignore-cols', help="Don't check fk constraints on specified columns (comma-separated)")
39+
parser.add_argument('--ignore-cols', help="Don't check foreign key constraints on specified columns (comma-separated)")
4040
args = parser.parse_args()
4141

4242
if args.version:

0 commit comments

Comments
 (0)