Gemfury build fails with SyntaxError - python

I followed the initial setup at the Gemfurey Dev docs and when trying to push to the fury master branch, the build is triggered and fails with SyntaxError
remote: Resolving deltas: 100% (86/86)
remote: Initializing build: done.
remote: -----> Building package...
remote: Python package build detected
remote: File "setup.py", line 17
remote: README: str = Path(HERE, "README.rst").read_text(encoding='utf-8')
remote: ^
remote: SyntaxError: invalid syntax
remote: -----> Problem building package!
I assume that the problem here is an incorrect version of python being run to build the package. I tried to check whether it is possible to configure the build to use the correct python version -- in this case 3.6 -- but there is no hint of such possibility.
Anything I can do to make these automatic builds work or is my only option to build the package locally and upload it to the fury index?
Thanks!

Unfortunately, ​Gemfury's current "git push" builder only supports Python 2 and there's no way to configure the runtime. If you're limited by this, I suggest building it locally or using another CI/CD solution to build and push it into your Gemfury account.

Related

Heroku app successfully deploying, but showing application error when loading the site

Below you can find the logs. Am I missing something here?
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/python
-----> Python app detected
-----> No Python version was specified. Using the same version as the last build: python-3.10.5
To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
-----> No change in requirements detected, installing from cache
-----> Using cached install of python-3.10.5
-----> Installing pip 22.1.2, setuptools 60.10.0 and wheel 0.37.1
-----> Installing SQLite3
-----> Installing requirements with pip
Ignoring backports.zoneinfo: markers 'python_version < "3.9"' don't match your environment
-----> $ python manage.py collectstatic --noinput
Found another file with the destination path 'admin/js/cancel.js'. It will be ignored since only the first
encountered file is collected. If this is not what you want, make
sure every static file has a unique path.
Found another file with the destination path 'admin/js/popup_response.js'. It will be ignored since only the
first encountered file is collected. If this is not what you want,
make sure every static file has a unique path.
1451 static files copied to '/tmp/build_9c61124b/static_cdn', 111 unmodified.
-----> Discovering process types
-----> Compressing...
Done: 116.3M
-----> Launching...
Released v13
https://dgrealstate.herokuapp.com/ deployed to Heroku
This app is using the Heroku-20 stack, however a newer stack is available.
To upgrade to Heroku-22, see:
https://devcenter.heroku.com/articles/upgrading-to-the-latest-stack

ERROR: Twisted-20.3.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform

Python 3.8.3, Scrapy 2.2.0 and Twisted-20.3.0-cp38-cp38-win_amd64.whl are installed on my computer. Everything works as expected.
I can’t install Scrapy without Twisted, so Twisted is also installed, but when I try to transfer the application to Heroku, an error appears. How do I use Scrapy on Heroku?
-----> Found python-3.6.10, removing
-----> Requirements file has been changed, clearing cached dependencies
-----> Installing python-3.8.3
-----> Installing pip
-----> Installing SQLite3
-----> Installing requirements with pip
ERROR: Twisted-20.3.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.
! Push rejected, failed to compile Python app.
! Push failed```
Remove Twisted-20.3.0-cp38-cp38-win_amd64.whl in your requirement.txt
I don't think it's required because while installing scrapy it will be taken care of

Flask application not deploying to Heroku (Problem with "ikp3db"?)

I was trying to deploy my app to Heroku the other day and I came across this error:
Collecting ikp3db==1.4
Could not find a version that satisfies the requirement ikp3db==1.4
What does ikp3db==1.4 mean? I tried removing it from my requirements.txt file and successfully pushed, although the default page ended up loading very slowly.
How do I fix this so that I can properly deploy my application?
For context, I am trying to push a Flask Application with Socket.io in it.
Here is the relevant part of the deploy log:
remote: -----> Python app detected
remote: -----> Installing requirements with pip
remote: Collecting ikp3db==1.4 (from -r /tmp/build_6a70450c1a3e03480c6a367846a7a630/requirements.txt (line 37))
remote: Could not find a version that satisfies the requirement ikp3db==1.4 (from -r /tmp/build_6a70450c1a3e03480c6a367846a7a630/requirements.txt (line 37)) (from versions: 1.0, 1.1, 1.1.2, 1.1.3, 1.1.4)
remote: No matching distribution found for ikp3db==1.4 (from -r /tmp/build_6a70450c1a3e03480c6a367846a7a630/requirements.txt (line 37))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
From its PyPI page:
IKP3db is a Python 3 debugger.
Generally speaking, debuggers shouldn't be deployed to production servers. They represent a significant security risk.
I tried removing it from my requirements.txt file and successfully pushed, although the default page ended up loading very slowly.
Removing a debugger wouldn't cause your application to be slow. There's something else going on. Start by looking at your browser's devtools to see if you can determine which part of the application is slow. Depending on what information you log, the heroku logs command may also be helpful here.

Heroku Python Webapp - pip is not found, and runtime is default despite runtime.txt

I am a novice and don't understand many of the concepts, so excuse me if there are some ambiguities or plain fallacies in my statements and questions.
I am writing a web app using Flask python framework. I have already tested it on localhost. Now I want to deploy it to heroku's webserver.
Here is the folder where the main files are stored:
static #this is a folder
templates #this is a folder
Procfile
requirements.txt
runtime.txt
app.py
Now here are the contents of Procfile, requirements.txt and runtime.txt respectively:
Procfile:
web: gunicorn app:app
requirements.txt:
Flask==0.12.2
gunicorn==19.7.1
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
Werkzeug==0.12.2
runtime.txt:
python-2.7.1
Now, it was python-3.5.1 in runtime.txt , before I had the problem but now during debugging I've left it as 2.7.1, because there's another problem I find.
Now when I try to execute the command: git push heroku master, the following ouptut is generated:
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (13/13), 1.95 KiB | 0 bytes/s, done.
Total 13 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.5.1
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote:
/app/tmp/buildpacks/{somelonghash}/bin/steps/pip-
install: line 7: /app/.heroku/python/bin/pip: No such file or
directory
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to joecrownwebapp.
remote:
To https://git.heroku.com/joecrownwebapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
'https://git.heroku.com/joecrownwebapp.git'
Where {somelonghash} was some long hash which for the purposes of this question I've removed. Now as you can see first the app is being deployed with python-3.5.1 which is strange given the fact that I've specified in runtime.txt that the runtime should be for example 2.7.1. Now we also see that pip is being installed and thereafter the requirements are being installed with pip and that is where the problem occurs.
The first question that comes to my mind is: Where exactly is this "/app/.heroku/python/bin/pip:" directory supposed to be, or for that matter "/app/tmp/buildpacks/{somelonghash}/bin/steps/pip-
install"?
Are they somewhere on my machine? (I figure not because if they are unix-based pathnames, then app should be directly under root, but I dont have such a folder)
If they are not on my machine where are they, how can I locate them and examine them. Are they somewhere on the Heroku server. If so, where does my problem arise from? Why is my runtime.txt disregarded?
Any ideas would be greatly appreciated!

heroku can't find pip when I push app to it

When I try to push my django app to heroku it fails right at the beginning:
remote: -----> Python app detected
remote: -----> Installing python-3.5.1
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: /app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/
bin/steps/pip-install: line 5: /app/.heroku/python/bin/pip:
No such file or directory
remote: ! Push rejected, failed to compile Python app.
remote:
I apparently do something wrong, but I did the same thing many times before. What's wrong?
I had this exact same problem yesterday and it was really frustrating as I had deployed to Django before under the exact same settings with no problem.
In your runtime.txt file change it from:
python-3.5.1
to
python-3.6.1
Why changing the Python version on Heroku matters beats me but it worked like a charm.

Categories

Resources