kofrasa / migrate Goto Github PK
View Code? Open in Web Editor NEWSimple language agnostic database migration tool
License: MIT License
Simple language agnostic database migration tool
License: MIT License
version
parameter doesn't exist which causes an exception to be thrown when launching migrate
or test_migrate
.
Traceback (most recent call last):
File "migrate.py", line 328, in <module>
main()
File "migrate.py", line 262, in main
""")
TypeError: __init__() got an unexpected keyword argument 'version'
======================================================================
ERROR: test_config_file (__main__.MigrateTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_migrate.py", line 92, in test_config_file
migrate.main('-f', filename, '--env', 'test', 'reset')
File "/home/gim/Workspace/migrate/migrate.py", line 262, in main
""")
TypeError: __init__() got an unexpected keyword argument 'version'
https://docs.python.org/3.5/library/argparse.html#argparse.ArgumentParser
Python version: 3.5.1
Unable to install the migrate package on Windows 10 OS:
(venv) C:\Users\vkvych\Projects\migrate-test>python --version
Python 3.6.1
(venv) C:\Users\vkvych\Projects\migrate-test>pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pip (9.0.1)
setuptools (38.2.3)
(venv) C:\Users\vkvych\Projects\migrate-test>pip install migrate
Collecting migrate
Using cached migrate-0.3.8.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\vkvych\AppData\Local\Temp\pip-build-23l1g8c8\migrate\setup.py", line 26, in <module>
import migrate
File "C:\Users\vkvych\AppData\Local\Temp\pip-build-23l1g8c8\migrate\migrate.py", line 18, in <module>
import pwd
ModuleNotFoundError: No module named 'pwd'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\vkvych\AppData\Local\Temp\pip-build-23l1g8c8\migrate\
migrate.py:15-23
According to PEP8, all module level imports should be on top of the file.
See Code lay-out:
Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants.
Imports should be grouped in the following order:
standard library imports related third party imports local application/library specific imports
You should put a blank line between each group of imports.
Put any relevant
__all__
specification after the imports.
migrate.py:206:1: exec_sqlite3 = lambda a, b, c, d: exec_mysql(a, b, None, d)
According to PEP8 this is an anti pattern.
See Programming Recommendations:
Always use a def statement instead of an assignment statement that binds a lambda expression directly to an identifier.
Yes:
def f(x): return 2*x
No:
f = lambda x: 2*x
The first form means that the name of the resulting function object is specifically 'f' instead of the generic ''. This is more useful for tracebacks and string representations in general. The use of the assignment statement eliminates the sole benefit a lambda expression can offer over an explicit def statement (i.e. that it can be embedded inside a larger expression)
Also, is it even being used? I couldn't find any reference to exec_sqlite3
in the code at all.
When I'm trying to launch migrate
the following exception ccurs:
Traceback (most recent call last):
File "/home/gim/.local/share/virtualenvs/flask/bin/migrate", line 11, in <module>
sys.exit(main())
File "/home/gim/.local/share/virtualenvs/flask/lib/python3.5/site-packages/migrate.py", line 240, in main
login_name = os.getlogin()
FileNotFoundError: [Errno 2] No such file or directory
It seems like os.getlogin()
is broken or not very stable. Maybe change it to pwd.getpwuid(os.getuid())[0]
as documentation suggests?
OS: Arch Linux x86_64
Python version: 3.5.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.