From 68fd69a56ed6922dd2a95d0d36bda3501edbd229 Mon Sep 17 00:00:00 2001 From: Kamil Sindi Date: Sat, 12 Sep 2020 14:51:24 -0400 Subject: [PATCH] Use twine --- .gitignore | 58 ++++++++++++++++++++++++++++++++++++++++++++--------- MANIFEST.in | 2 +- Makefile | 54 +++++++++++++++++++++++++++++++++++++------------ README.rst | 45 ----------------------------------------- setup.cfg | 2 +- setup.py | 6 +++--- 6 files changed, 94 insertions(+), 73 deletions(-) delete mode 100644 README.rst diff --git a/.gitignore b/.gitignore index 51cbe85..0bc32fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] +*$py.class # C extensions *.so @@ -8,11 +9,12 @@ __pycache__/ # Distribution / packaging .Python env/ -bin/ build/ develop-eggs/ dist/ +downloads/ eggs/ +.eggs/ lib/ lib64/ parts/ @@ -22,6 +24,12 @@ var/ .installed.cfg *.egg +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + # Installer logs pip-log.txt pip-delete-this-directory.txt @@ -30,25 +38,55 @@ pip-delete-this-directory.txt htmlcov/ .tox/ .coverage +.coverage.* .cache nosetests.xml coverage.xml +*,cover +.hypothesis/ # Translations *.mo - -# Mr Developer -.mr.developer.cfg -.project -.pydevproject - -# Rope -.ropeproject +*.pot # Django stuff: *.log -*.pot +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy # Sphinx documentation docs/_build/ +# PyBuilder +target/ + +# IPython Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# dotenv +.env + +# virtualenv +venv/ +ENV/ + +# Spyder project settings +.spyderproject + +# Rope project settings +.ropeproject + +# PyCharm +.idea/ diff --git a/MANIFEST.in b/MANIFEST.in index 5488969..40128c7 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include tox.ini +include LICENSE README.md tox.ini diff --git a/Makefile b/Makefile index f377a28..c523df2 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,59 @@ -.PHONY: clean-pyc clean-build docs clean build install install-all version +.PHONY: clean build install version release dist help: @echo "clean-build - remove build artifacts" - @echo "clean-pyc - remove Python file artifacts" + @echo "clean-test - remove Python file artifacts" + @echo "clean-eggs - remove cached eggs" + @echo "build - build package" + @echo "version - get version number" + @echo "install - install packages" + @echo "test - run tests quickly with the default Python" + @echo "test-all - run tests on every Python version with tox" @echo "release - package and upload a release" @echo "dist - package" -clean: clean-build clean-pyc +clean: clean-build clean-test clean-eggs + rm -rf htmlcov/ clean-build: rm -rf build/ rm -rf dist/ rm -rf *.egg-info -clean-pyc: - find . -name '*.pyc' -exec rm -f {} + - find . -name '*.pyo' -exec rm -f {} + - find . -name '*~' -exec rm -f {} + +.PHONY: clean-test +clean-test: + find . | grep -E "(__pycache__|\.pyc|\.pyo$$)" | xargs rm -rf + rm -rf .pytest_cache/ + +.PHONY: clean-eggs +clean-eggs: + rm -rf .eggs/ + +.PHONY: build +build: clean-build clean-eggs + python3 setup.py build_ext --inplace + +install: clean-build + python3 setup.py install version: - python setup.py --version + python3 setup.py --version + +.PHONY: test +test: + python3 setup.py test + +.PHONY: test-all +test-all: + tox +.PHONY: release release: clean build - python setup.py sdist upload - python setup.py bdist_wheel upload + python3 setup.py sdist bdist_wheel + twine check dist/* + twine upload --verbose dist/* +.PHONY: dist dist: clean build - python setup.py sdist - python setup.py bdist_wheel - ls -l dist + python3 setup.py sdist bdist_wheel + twine check dist/* diff --git a/README.rst b/README.rst deleted file mode 100644 index 9b10c59..0000000 --- a/README.rst +++ /dev/null @@ -1,45 +0,0 @@ -flask-sqlacodegen -================= - -GitHub page: -`flask-sqlacodegen `__ - -Fork of `sqlacodegen `__ by -Alex Gronholm. Based off of version 1.1.6. - -What's different: - -- Support for Flask-SQLAlchemy syntax using ``--flask`` option. -- Defaults to generating backrefs in relationships. ``--nobackref`` - still included as option in case backrefs are not wanted. -- Naming of backrefs is class name in snake\_case (as opposed to - CamelCase) and is pluralized if it's Many-to-One or Many-to-Many - using `inflect `__. -- Primary joins are explicit. -- 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 setup. -- ``--ignore-cols`` ignores special columns 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``. -- Uses the command ``flask-sqlacodgen`` instead of ``sqlacodegen``. -- Added support for ``--notables`` to only generate model classes, even for association tables - -Install -------- - -With pip: - -:: - - pip install flask-sqlacodegen - -Without pip: - -:: - - git clone https://github.com/ksindi/flask-sqlacodegen.git - cd flask-sqlacodegen/ - python setup.py install - diff --git a/setup.cfg b/setup.cfg index d669e0e..25e98b5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ description-file = README.md max-line-length = 120 exclude = .tox -[pytest] +[tool:pytest] pep8maxlinelength = 120 addopts = --tb=short diff --git a/setup.py b/setup.py index b38222e..4ef9980 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,8 @@ def run_tests(self): setup( name='flask-sqlacodegen', description='Automatic model code generator for SQLAlchemy with Flask support', - long_description=open('README.rst').read(), + long_description=open("README.md").read(), + long_description_content_type="text/markdown", version=sqlacodegen.version, author='Kamil Sindi', classifiers=[ @@ -36,7 +37,6 @@ def run_tests(self): 'Topic :: Database', 'Topic :: Software Development :: Code Generators', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', @@ -44,7 +44,7 @@ def run_tests(self): 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7' + 'Programming Language :: Python :: 3.7', ], keywords=['sqlalchemy', 'sqlacodegen', 'flask'], license='MIT',