-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use python3 in marketplace #29
Conversation
…path and remove the expectation for a virtualenv
Thanks for testing, @wpotrzebowski. I'll take a look into file type allowances and run some tests locally. |
@wpotrzebowski, I just tested this myself and was able to upload a python file without issue. The mime type error you get with My successful upload: https://marketplacedev.sasview.org/models/147/ |
I've tested at least 5 different model files and each time I was getting the same error. Could it be beacuse I am uploading from Mac (i.e. file has different type on Mac than on Windows)? |
Looking deeper, the |
The workflow does no deployment. It is used to ensure the build, migrations, and tests all work properly. If desired, I could add a deployment step to push any changes to the server, but changes require a restart of apache to take effect, which would be safer to do from within the server. |
Suggested reword: |
@wpotrzebowski The changes are now applied to the development server. Can you try to upload a model when you get a chance? |
@krzywon Indeed, I can upload python files now! However, the identical/simillar error ocurs when trying to upload c file: |
I'm leary of allowing any file of type |
Here is the official definition for the mime type
|
I think it is probably correct to not accept it, however, the fix should probably be getting whatever is determining the mime type to correctly identify c source. |
@wpotrzebowski, I've changed how the mime checking is done. The mime is based on the file contents, using the My only question is at this point, should I limit the file extensions as well? |
Not sure what you mean @krzywon? Are you suggesting we only allow .py and .c? I guess it may be good form to insist that a c file be *.c (not *.cpp :-) and that python be *.py? How do we upload the x,y data for the plot? That should allow any extension that is plain text? |
That's exactly what I'm asking, @butlerpd, but also allow |
I see. I guess I don't have a strong feeling either way. Maybe the answer then should be NOT to restrict until there is an actual identified problem in doing so? |
@krzywon I've tested *.c files and they work fine (so as *.py and *.txt files). *.txt files can also be added to models (not only as a part of example data). Is this is intended behavior - maybe is a part of your question? In my opinion we should only allow *.c and *.py extension in model section. |
Thanks for checking, @wpotrzebowski. Limiting the file extensions for the model files makes sense and I'll see if I can have that ready today. |
The dev server is now limiting model files to .py and .c extensions. No file extension limits are set for the example data because the data won't be stored if it is not multi-column ASCII text. |
Example data is limitted to text files and works as expected. |
This should finalize the work started by @arm61 in PR #24 transitioning python2 -> python3. The development server is currently running off this branch.
Fixes #6 - The development server is running MySQL
Fixes #22 - The development server is running python3
Fixes #23 - Uses the latest version of Django (v4.0.6 on the development server)
Fixes #19 - 19 and 23 could almost be considered duplicate tickets
No ticket - Use Github actions for deployment and unit testing (removing all Travis CI).