nathanurwin / cookiecutter-git Goto Github PK
View Code? Open in Web Editor NEWGit repo project template using Cookiecutter :cookie:
License: MIT License
Git repo project template using Cookiecutter :cookie:
License: MIT License
You indicated pty=True, but your platform doesn't support the 'pty' module!
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)
Cookiecutter must be installed with pip
rather than system package managers (apt
, brew
, etc.) or else the invoke
bin dir won't be in $PATH
. Thanks @dylantyates for the heads up! ๐
Travis CI doesn't support Windows. See https://www.appveyor.com/
Hello there, sweet cookie it helped me setup a bunch of repos, thanks ๐
I had no use for the python tasks though, so I wondered what they're meant for?
Why format python code on an empty directory?
Also why have a script copy static files into the target? Can't it be done manually, beforehand in the repo slug template?
May-be it's to avoid duplicating code between parent/child repos?
$ cookiecutter gh:nathanurwin/cookiecutter-git --no-input -f
Removing '/home/user/Projects/.github/cookiecutter-git-demo/NOTICE'...
git init
Reinitialized existing Git repository in /home/user/Projects/.github/cookiecutter-git-demo/.git/
git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
git add -A
git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
1: ['git', 'commit', '-m', 'Initial commit']
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
Traceback (most recent call last):
File "/tmp/tmp4emWQB.py", line 201, in <module>
main()
File "/tmp/tmp4emWQB.py", line 196, in main
setup_git_repo()
File "/tmp/tmp4emWQB.py", line 123, in setup_git_repo
run(['git', 'commit', '-m', 'Initial commit'])
File "/tmp/tmp4emWQB.py", line 34, in run
raise error
subprocess.CalledProcessError: Command '['git', 'commit', '-m', 'Initial commit']' returned non-zero exit status 1
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)
Such as the repo being public or private, etc.
Let users know that if they're forking to provide their own default prompt values there are better ways!
cookiecutter gh:nathanurwin/cookiecutter-git --no-input remote_provider="gitlab.com"
cookiecutter gh:nathanurwin/cookiecutter-git --replay
To test different python versions, i.e. 2.7, 3.4, 3.5, 3.6, and 3.7 without having to commit and push.
Users looking to copy cookiecutter-git's features can fork or clone the repo. Feature is currently broken due to a typo in the hook file (should be "True"
instead of "true"
).
Traceback (most recent call last):
File "c:\users\user\appdata\local\temp\tmp3fjavw.py", line 138, in <module>
main()
File "c:\users\user\appdata\local\temp\tmp3fjavw.py", line 133, in main
setup_git_repo()
File "c:\users\user\appdata\local\temp\tmp3fjavw.py", line 125, in setup_git_repo
create_remote_repo()
File "c:\users\user\appdata\local\temp\tmp3fjavw.py", line 97, in create_remote_repo
getpass.getpass(prompt).strip())
File "c:\python27\lib\getpass.py", line 95, in win_getpass
msvcrt.putch(c)
TypeError: putch() argument 1 must be char, not unicode
Coming in v0.2.0
.
$ pipenv run inv tests
usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --cov=.
inifile: None
rootdir: C:\Users\user\Projects\nathanurwin\cookiecutter-git
I put in an empty github password and this happened.
Traceback (most recent call last):
File "/var/folders/1b/24l2xs_d4yl6kfk37bmv4z740000gn/T/tmpxBSc3r.py", line 207, in <module>
main()
File "/var/folders/1b/24l2xs_d4yl6kfk37bmv4z740000gn/T/tmpxBSc3r.py", line 202, in main
setup_git_repo()
File "/var/folders/1b/24l2xs_d4yl6kfk37bmv4z740000gn/T/tmpxBSc3r.py", line 165, in setup_git_repo
requests.post(create_remote_url, data=data, headers=headers)
File "/var/folders/1b/24l2xs_d4yl6kfk37bmv4z740000gn/T/tmpxBSc3r.py", line 79, in post
return cls._request(url, headers, data, log)
File "/var/folders/1b/24l2xs_d4yl6kfk37bmv4z740000gn/T/tmpxBSc3r.py", line 53, in _request
response = urlopen(req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)>
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)
Basic Auth is the default auth method. Need to add something more secure such as OAuth access tokens.
Currently, the error message does not stand out. Need to add invalid gitlab token exception handling to print a clearer error message.
Fix gitlab.com as remote_provider
410 Gone: https://gitlab.com/api/v3/namespaces?search=NathanUrwin
{"error":"API V3 is no longer supported. Use API V4 instead."}
Steps to reproduce the behavior:
gitlab.com
as remote_provider
201 created
Use invoke and requests by default, but fallback to the standard library subprocess and urllib packages if possible. This will make cookiecutter the only required dependency, and hopefully allow more users to use the project.
Add example .cookiecutterrc to see default config in shell form.
Would help address .cookiecutterrc problems for noobs like myself.
An example .cookiecutterrc on the master branch of this repo.
70% or more
After input of password to my account from command line I received exception:
Traceback (most recent call last):
File "/tmp/tmpr61y4z6r.py", line 203, in
main()
File "/tmp/tmpr61y4z6r.py", line 198, in main
setup_git_repo()
File "/tmp/tmpr61y4z6r.py", line 129, in setup_git_repo
auth_base = base64.b64encode('{}:{}'.format(*auth_info))
File "/home/oshcherbyna/PycharmProjects/test_venv/lib/python3.6/base64.py", line 58, in b64encode
encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not 'str'
Stopping generation because post_gen_project hook script didn't exit successfully
By "repo_slug dirs" I mean the {{cookiecutter.repo_slug}}
and {{cookiecutter.repo_slug}}/{{cookiecutter.repo_slug}}
dirs.
UnboundLocalError: local variable 'namespace_id' referenced before assignment
Keys should be more verbose, make more sense, and generally just be clearer in what is being asked. Such as {{cookiecutter.repository_slug}}
over {{cookiecutter.repo_name}}
.
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _ |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \____|\___|\___\___/ \_/
v2.0.15
==> Detecting CI provider
AppVeyor Detected
==> Preparing upload
Error running `cd 'C:\projects\cookiecutter-git' && git ls-files`: None
==> Processing gcov (disable by -X gcov)
Executing gcov (find 'C:\projects\cookiecutter-git' -not -path './bower_components/**' -not -path './node_modules/**' -not -path './vendor/**' -type f -name '*.gcno' -exec gcov -pb {} +)
Error running `find 'C:\projects\cookiecutter-git' -not -path './bower_components/**' -not -path './node_modules/**' -not -path './vendor/**' -type f -name '*.gcno' -exec gcov -pb {} +`: None
==> Collecting reports
XX> Searching for reports disabled
Generating coverage xml reports for Python
+ C:\projects\cookiecutter-git\coverage.xml bytes=12690
==> Uploading
.url https://codecov.io
.query service=appveyor&package=py2.0.15&job=NathanUrwin%2Fcookiecutter-git%2Fv0.5.1%2Bappveyor.8&build=7bbbwhasw858k7f3&branch=master&commit=758dd04cb92b3b1def7a59639c72c4ad938dc535&slug=NathanUrwin%2Fcookiecutter-git
Pinging Codecov...
Direct to s3 failed. Using backup v2 endpoint.
Uploading to Codecov...
HTTP 404
Not Found
Error: 404 Client Error: Not Found for url: https://codecov.io/upload/v2?service=appveyor&package=py2.0.15&job=NathanUrwin%2Fcookiecutter-git%2Fv0.5.1%2Bappveyor.8&build=7bbbwhasw858k7f3&branch=master&commit=758dd04cb92b3b1def7a59639c72c4ad938dc535&slug=NathanUrwin%2Fcookiecutter-git
gpg: cannot open tty `no tty': No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Temp\tmpw7r37qjr.py", line 429, in <module>
main()
File "C:\Users\user\AppData\Local\Temp\tmpw7r37qjr.py", line 424, in main
PostGenProjectHook().run()
File "C:\Users\user\AppData\Local\Temp\tmpw7r37qjr.py", line 416, in run
self._git_repo()
File "C:\Users\user\AppData\Local\Temp\tmpw7r37qjr.py", line 368, in _git_repo
self.git_commit()
File "C:\Users\user\AppData\Local\Temp\tmpw7r37qjr.py", line 220, in git_commit
run("git commit --message {}".format(quote(message)))
File "c:\python37\lib\site-packages\invoke\__init__.py", line 40, in run
return Context().run(command, **kwargs)
File "c:\python37\lib\site-packages\invoke\context.py", line 93, in run
return self._run(runner, command, **kwargs)
File "c:\python37\lib\site-packages\invoke\context.py", line 100, in _run
return runner.run(command, **kwargs)
File "c:\python37\lib\site-packages\invoke\runners.py", line 268, in run
return self._run_body(command, **kwargs)
File "c:\python37\lib\site-packages\invoke\runners.py", line 401, in _run_body
raise UnexpectedExit(result)
invoke.exceptions.UnexpectedExit: Encountered a bad command exit code!
Command: 'git commit --message ^"Initial commit^"'
Exit code: 128
Stdout: already printed
Stderr: already printed
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)
Password for 'https://NathanUrwin@github.com':
fatal: HttpRequestException encountered.
An error occurred while sending the request.
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Password for 'https://NathanUrwin@github.com': No error
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Temp\tmpvrxz271b.py", line 384, in <module>
main()
File "C:\Users\user\AppData\Local\Temp\tmpvrxz271b.py", line 379, in main
PostGenProjectHook().run()
File "C:\Users\user\AppData\Local\Temp\tmpvrxz271b.py", line 371, in run
self._git_repo()
File "C:\Users\user\AppData\Local\Temp\tmpvrxz271b.py", line 328, in _git_repo
self._git_push()
File "C:\Users\user\AppData\Local\Temp\tmpvrxz271b.py", line 265, in _git_push
watchers=watchers,
File "c:\python37\lib\site-packages\invoke\__init__.py", line 49, in run
return Context().run(command, **kwargs)
File "c:\python37\lib\site-packages\invoke\context.py", line 94, in run
return self._run(runner, command, **kwargs)
File "c:\python37\lib\site-packages\invoke\context.py", line 101, in _run
return runner.run(command, **kwargs)
File "c:\python37\lib\site-packages\invoke\runners.py", line 271, in run
return self._run_body(command, **kwargs)
File "c:\python37\lib\site-packages\invoke\runners.py", line 404, in _run_body
raise UnexpectedExit(result)
invoke.exceptions.UnexpectedExit: Encountered a bad command exit code!
Command: 'git push --set-upstream origin master'
Exit code: 128
Stdout: already printed
Stderr: already printed
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 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.