marmida / s3pub Goto Github PK
View Code? Open in Web Editor NEWPublish websites to S3
License: MIT License
Publish websites to S3
License: MIT License
Installing without dependencies in development.txt
leads to ImportError
during run
Traceback (most recent call last):
File "/home/marmida/venvs/s3pub-test/bin/s3pub", line 9, in <module>
load_entry_point('s3pub==0.1.0', 'console_scripts', 's3pub')()
File "/home/marmida/venvs/s3pub-test/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 546, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/marmida/venvs/s3pub-test/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2666, in load_entry_point
return ep.load()
File "/home/marmida/venvs/s3pub-test/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2339, in load
return self.resolve()
File "/home/marmida/venvs/s3pub-test/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2345, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/home/marmida/venvs/s3pub-test/local/lib/python2.7/site-packages/s3pub/cmdline.py", line 9, in <module>
import yaml
ImportError: No module named yaml
Trying a basic run under Python 3 causes this error:
(s3pub-test-py3)marmida@longan:~/develop/s3pub$ PYTHONPATH=. python s3pub/cmdline.py /tmp/testup/ s3pub-test/up20150903/
Traceback (most recent call last):
File "s3pub/cmdline.py", line 155, in <module>
main()
File "s3pub/cmdline.py", line 146, in main
args.src.decode('utf-8'),
AttributeError: 'str' object has no attribute 'decode'
Unit tests fail under Python 3 because of string / unicode changes:
(s3pub-test-py3)marmida@longan:~/develop/s3pub$ nosetests
................................EE
======================================================================
ERROR: do_upload: returns only modified keys when there is no index document.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/marmida/develop/s3pub/s3pub/tests/test_upload.py", line 247, in wrapped
return func(mock_todos, mock_connection, mock_creds)
File "/home/marmida/develop/s3pub/s3pub/tests/test_upload.py", line 257, in test_do_upload_no_website
set(upload.do_upload('bogus', 'bogus', False, mock_creds)),
File "/home/marmida/develop/s3pub/s3pub/upload.py", line 150, in do_upload
dict((lpath, info[2]) for lpath, (info, _) in iteritems(to_upload)))
File "/home/marmida/develop/s3pub/s3pub/progress.py", line 30, in __init__
progressbar.Bar(left='[', right=']'),
File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/progressbar/widgets.py", line 354, in __init__
self.marker = _marker(marker)
File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/progressbar/widgets.py", line 348, in _marker
if isinstance(marker, basestring):
NameError: name 'basestring' is not defined
======================================================================
ERROR: do_upload: adds directory paths when index documents are invalidated.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/marmida/develop/s3pub/s3pub/tests/test_upload.py", line 247, in wrapped
return func(mock_todos, mock_connection, mock_creds)
File "/home/marmida/develop/s3pub/s3pub/tests/test_upload.py", line 283, in test_do_upload_with_website
set(upload.do_upload('bogus', 'bogus', False, mock_creds)),
File "/home/marmida/develop/s3pub/s3pub/upload.py", line 150, in do_upload
dict((lpath, info[2]) for lpath, (info, _) in iteritems(to_upload)))
File "/home/marmida/develop/s3pub/s3pub/progress.py", line 30, in __init__
progressbar.Bar(left='[', right=']'),
File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/progressbar/widgets.py", line 354, in __init__
self.marker = _marker(marker)
File "/home/marmida/venvs/s3pub-test-py3/lib/python3.4/site-packages/progressbar/widgets.py", line 348, in _marker
if isinstance(marker, basestring):
NameError: name 'basestring' is not defined
----------------------------------------------------------------------
Ran 34 tests in 0.086s
FAILED (errors=2)
This is a real nasty behavior: when run a second time with the same parameters, it looks like s3pub
deletes the files just uploaded the first time, even though it goes through the work to upload the files:
(s3pub)marmida@longan:/tmp/what$ s3pub . sdna-web-test/s3pub-test/
./adir/bfile (2/2) 100% [###########################################################] Time: 0:00:00 34.10 B/s
(s3pub)marmida@longan:/tmp/what$ /app/bin/s3cmd ls -r s3://sdna-web-test/
2015-09-09 19:55 9 s3://sdna-web-test/s3pub-test/adir/bfile
2015-09-09 19:55 6 s3://sdna-web-test/s3pub-test/afile
(s3pub)marmida@longan:/tmp/what$ s3pub . sdna-web-test/s3pub-test/
./adir/bfile (2/2) 100% [###########################################################] Time: 0:00:00 33.78 B/s
(s3pub)marmida@longan:/tmp/what$ /app/bin/s3cmd ls -r s3://sdna-web-test/
(s3pub)marmida@longan:/tmp/what$
First, the files should not be modified - they should all be skipped, because the local files match the contents of the remote files.
Second, the files should certainly not be deleted. The program instead should exit without making any modifications or producing any output, even progress bar output.
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.