Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix upload to PyPI of new release tags #8

Closed
simonw opened this issue Jun 27, 2018 · 12 comments
Closed

Fix upload to PyPI of new release tags #8

simonw opened this issue Jun 27, 2018 · 12 comments

Comments

@simonw
Copy link
Owner

simonw commented Jun 27, 2018

It failed with an error, so I did the first release by hand:

https://travis-ci.com/simonw/datasette-vega/jobs/131529892

1.56s$ pip install -U pip wheel
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting pip
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting wheel
  Downloading https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl (41kB)
Installing collected packages: pip, wheel
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/usr/lib/python2.7/shutil.py", line 303, in move
    os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/bin/pip'
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
simonw pushed a commit that referenced this issue Jun 28, 2018
@simonw
Copy link
Owner Author

simonw commented Jun 28, 2018

Failed with a different error:

https://travis-ci.com/simonw/datasette-vega/jobs/131870251

running build_static
sh: 1: react-scripts: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! datasette-vega@0.1.0 build: `react-scripts build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the datasette-vega@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2018-06-28T14_53_07_404Z-debug.log
Traceback (most recent call last):
  File "setup.py", line 65, in <module>
    install_requires=['datasette']
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/opt/python/3.6.3/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/opt/python/3.6.3/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/opt/python/3.6.3/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 20, in run
    self.run_command('build_static')
  File "/opt/python/3.6.3/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/opt/python/3.6.3/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 34, in run
    check_output(['npm', 'run', 'build'], cwd=ROOT)
  File "/opt/python/3.6.3/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/opt/python/3.6.3/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['npm', 'run', 'build']' returned non-zero exit status 1.
ValueError: Cannot find file (or expand pattern): 'dist/*'

@simonw
Copy link
Owner Author

simonw commented Jul 6, 2018

This might mean that I need to run npm install in my build_static command:

datasette-vega/setup.py

Lines 33 to 37 in 82fccca

def run(self):
check_output(['npm', 'run', 'build'], cwd=ROOT)
check_output(['mkdir', '-p', 'datasette_vega/static'], cwd=ROOT)
check_output("mv build/static/js/*.js datasette_vega/static/datasette-vega.js", shell=True, cwd=ROOT)
check_output("mv build/static/css/*.css datasette_vega/static/datasette-vega.css", shell=True, cwd=ROOT)

@simonw
Copy link
Owner Author

simonw commented Jul 6, 2018

I was able to recreate the failure locally by doing the following:

cd /tmp
git clone git@github.com:simonw/datasette-vega
cd datasette-vega
python3 setup.py build_static

This confirmed that I need to run npm install.

@simonw
Copy link
Owner Author

simonw commented Jul 6, 2018

So nearly works! https://travis-ci.com/simonw/datasette-vega/jobs/133096532

Uploading datasette_vega-0.5-py3-none-any.whl
100%|██████████| 295k/295k [00:00<00:00, 588kB/s] 
HTTPError: 403 Client Error: Invalid or non-existent authentication information. for url: https://upload.pypi.org/legacy/

@simonw
Copy link
Owner Author

simonw commented Jul 6, 2018

1326b07 may have fixed this.

@simonw
Copy link
Owner Author

simonw commented Jul 6, 2018

This time I tried generating the password section using the travis setup pypi wizard.

@simonw
Copy link
Owner Author

simonw commented Jul 7, 2018

I'll try it again, following travis-ci/travis-ci#9169 which says to use travis encrypt -r simonw/datasette-vega

simonw added a commit that referenced this issue Jul 7, 2018
This time I generated the secure field like this:

    $ travis encrypt -r simonw/datasette-vega
    Reading from stdin, press Ctrl+D when done
    PASTED-PASSWORD-HERE - then hit enter
    <Ctrl+D>
    Please add the following to your .travis.yml file:

      secure: "n..."
@simonw
Copy link
Owner Author

simonw commented Jul 10, 2018

@simonw
Copy link
Owner Author

simonw commented Jul 10, 2018

travis-ci/travis-ci#8339 (comment)

echo -n "<my password>" | travis encrypt --add deploy.password -r simonw/datasette-vega

Applied in bad9715

@simonw
Copy link
Owner Author

simonw commented Jul 10, 2018

@simonw simonw mentioned this issue Jul 10, 2018
@simonw
Copy link
Owner Author

simonw commented Jul 10, 2018

I switched to using a secret PYPI_PASSWORD setting in 5cc4e52 - and, it worked!

https://travis-ci.com/simonw/datasette-vega/jobs/133595898

0.6.1 now shipped to https://pypi.org/project/datasette-vega/

@simonw simonw closed this as completed Jul 10, 2018
@AdrienHorgnies
Copy link

@simonw Thanks for the information, I couldn't get to publish my python package using travis encrypted password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants