TravisCI deploy cannot find setup.py - python

It seems like it should be fairly easy to set up automatic releases of my python project (on GitHub) to PyPi: https://docs.travis-ci.com/user/deployment/pypi/
So, I added the following to my .travis.yml:
deploy:
provider: pypi
user: DanHickstein
on:
tags: true
password:
secure: GHhpt4Ssv2VQh6...
It almost works, but I get the following error of TravisCI:
Preparing deploy
Authenticated as DanHickstein
Deploying application
python: can't open file 'setup.py': [Errno 2] No such file or directory
ValueError: Cannot find file (or expand pattern): 'dist/*'
python: can't open file 'setup.py': [Errno 2] No such file or directory
I cannot fathom why setup.py cannot be found. It is right there in the same directory as .travis.yml...

The problem is the following line in the install stage:
- cd ~/
Make sure you are back in the root of your projects directory before deploying, maybe in the before_deploy stage.

Related

How to start pipenv

I have been try to my pipenv going but it gives me this error
Creating a virtualenv for this project…
Pipfile: C:\Users\User\Pipfile
Using C:/Python/Python37/python.exe (3.7.1) to create virtualenv
[ ==] Creating virtual environment...FileNotFoundError: [Errno 2] No such file or directory
'c:\\python\\python37\\Lib\\venv\\scripts\\nt\\python.exe'
Failed creating virtual environment here
I tried to changed the file path made sure it is in same path as where python is installed still get the same problem.
copy following files from python location(C:\Program Files\Python37) to the (C:\Program Files\Python37\Lib\venv\scripts\nt)
1) python_d.exe
2) python_d.pdb
3) pythonw_d.exe
4) pythonw_d.pdb
thanks this solved the problem just one question if i want to use git clone command which filepath should i used?
because if i used the git clone command in same path
C:\Users\User>git clone https://github.com/jadhavpritish/Dream11_Predictor.git
C:\Users\User>pipenv run python src/player_selection_dream11.py
C:\Users\User\.virtualenvs\User-jBUq-HwN\Scripts\python.exe: can't open file 'src/player_selection_dream11.py': [Errno 2] No such file or directory
Okay! So what I just did to resolve it is that;
This message popped up (Shortly)
[ ==] Creating virtual environment...FileNotFoundError: [Errno 2] No such file or directory: 'c:\\users\\arham rumi\\appdata\\local\\programs\\python\\python37-32\\Lib\\venv\\scripts\\nt\\python.exe'
Then I went to the mentioned directory, and there was no such file like python.exe
Then I went back to python37-32 folder or you can simply go to the directory where you have that python.exe file. Copy this and paste it to the directory mentioned in the error.
And that's how I resolved this problem

How to add whl file on pip requirements files?

Assuming you created a whl of a proprietary project and would like to reuse it in another python project, how to indicate it via a relative path in a pip file without exposing whl online?
Although there is no direct description for this problem, from the documentation (https://pip.readthedocs.io/en/1.1/requirements.html) I have tried the following:
Indicate using -e file:
./folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl#egg=my-project==0.1.0
got> NotADirectoryError: [Errno 20] Not a directory
Indicate using file:
./folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl#egg=my-project==0.1.0
got> FileNotFoundError: [Errno 2] No such file or directory:
'/folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl'
It seems to seek the file on the root folder instead of the relative one.
Indicate without file:
folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl got> Invalid
requirement: 'folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl'
It looks like a path. Does it exist ?
It appears that if I indicate the folder instead it will work.
But as this is not the case, does anyone know how to fix it?
numpy
pandas
file:./folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl#egg=my-project==0.1.0
Pip install whl file using relative path with success!

Flask app on Cloud Foundry - Command "python setup.py egg_info" failed with error code 1

I am trying to push a Python (3.6.5) app via Flask to Cloud Foundry (cf version 6.36.1+e3799ad7e.2018-04-04). The application takes a POST request (text file), does some text transformation, saves the new file, and returns a confirmation message. It works locally (tested via Postman). However, when attempting to push it to CF, it gives the following error -
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ygzuah5g/logging/
Could you please let me know how I can go about solving this issue? Thanks in advance. The entire files together are ~ 350 MB. I am using a manifest.yml
---
applications:
- name: textsum
memory: 512M
command: python server.py
buildpack: https://github.com/cloudfoundry/buildpack-python.git
PS - Not sure if this is helpful, I do have import queue in one of my files. If I change it to import Queue (Py 2x compatible) and use Py 2.7.15 runtime, the cf push is successful, but it throws runtime errors
ERROR in app: Exception on / [POST]
File "/home/vcap/deps/0/python/lib/python2.7/subprocess.py", line 1047, in _execute_child
ERR raise child_exception
ERR OSError: [Errno 2] No such file or directory
ERR 10.0.65.11 - - [12/Jun/2018 20:56:16] "POST / HTTP/1.1" 500 -
First. Don't do this in your manifest.yml:
buildpack: https://github.com/cloudfoundry/buildpack-python.git
This is telling Cloud Foundry to use the master branch of the buildpack which can change quite frequently and there are no guarantees of it's fitness (i.e. it could even be broken).
Instead, make sure that you are using a release. Releases are tested and the code won't change out from under you.
You can do this by using the platform supplied Python buildpack, simply remove this line or put python_buildpack as the name, or you can point to buildpack: https://github.com/cloudfoundry/buildpack-python.git#v1.6.17 where v1.6.17 is a release from here.
https://github.com/cloudfoundry/python-buildpack/releases
Second, it seems like you need to tell Cloud Foundry & the buildpack which version of Python you want. If you need Python 3, then you should tell it that. See here for instructions on doing that.
https://stackoverflow.com/a/50837696/1585136
Third, this error:
ERR OSError: [Errno 2] No such file or directory
Seems like you're trying to write to a location that does not exist. Where are you trying to write your file? The paths will be different on your local machine vs running on Cloud Foundry. Typically on Cloud Foundry, you would write temporary files to /home/vcap/tmp or /app/tmp (/app is a symlink to /home/vcap) or $HOME/tmp. They all point to the same place.
I'm specifically mentioning temporary files here because you don't want to write permanent files to the local file system on Cloud Foundry. The local file system is ephemeral and your data will not persist for very long. See here for details.
https://docs.cloudfoundry.org/devguide/deploy-apps/prepare-to-deploy.html#filesystem
Hope that helps!

Django pipeliner: /usr/bin/env: yuicompressor: No such file or directory

I have the following versions of django and django-pipeline:
Django==1.10.3
django-pipeline==1.6.9
In /usr/bin/ I see "yui-compresssor" listed. Running collectstatic gives the following error.
pipeline.exceptions.CompressorError: /usr/bin/env: yuicompressor: No such file or directory
When I run my site with debug set to false it loads OK, but when debug is false I just get a 500 error page so the problem is when it is trying to compress the assets.
On my production settings file I have...
PIPELINE['CSS_COMPRESSOR'] = 'pipeline.compressors.yui.YUICompressor'
PIPELINE['JS_COMPRESSOR'] = 'pipeline.compressors.yui.YUICompressor'
Am I missing anything?
It should be
YUI_BINARY = '/usr/bin/yui-compressor'
Because '/usr/bin/env yui-compressor' is not path to binary
Another way to fix this is to create symlink
sudo ln -s /usr/bin/yui-compressor /usr/bin/yuicompressor

Google App Engine deployment: missing file

I have a problem with google app engine. It used to work but now I can't figure out whats wrong...
python: can't open file 'google_appengine/dev_appserver.py': [Errno 2] No such file or directory
apologize for the delay in getting back to this.
1) it happens when command is executed outside google_appengine directory e.g.
abid#abid-webdev:~/Documents/GAE_projects/helloworld$ python google_appengine/dev_appserver.py helloworld/
python: can't open file 'google_appengine/dev_appserver.py': [Errno 2] No such file or directory
2) now when i run from the directory where i have
"google_appengine folder" and project, it works grand :)
abid#abid-webdev:~/Documents/GAE_projects$ ls
google_appengine helloworld
abid#abid-webdev:~/Documents/GAE_projects$ python google_appengine/dev_appserver.py helloworld/
Allow dev_appserver to check for updates on startup? (Y/n): y
dev_appserver will check for updates on startup. To change this setting, edit /home/abid/.appcfg_nag
3) another thing i noticed, google docs says->[https://developers.google.com/appengine/docs/python/gettingstartedpython27/helloworld][1] to use ->
google_appengine/dev_appserver.py helloworld/ this command -
whereas i used
python google_appengine/dev_appserver.py helloworld/ as suggested on udacity forums->
http://forums.udacity.com/questions/6003945/with-opensuse-121-the-python-app-refuses-to-work
thanks all for your help. cheers

Categories