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

Drop python 2 support #35

Merged
merged 6 commits into from
May 24, 2020
Merged

Drop python 2 support #35

merged 6 commits into from
May 24, 2020

Conversation

craigds
Copy link
Member

@craigds craigds commented May 19, 2020

Drops support for python 2. Fixes #34

This should probably go in the next minor release, i.e 0.5, rather than a 0.4.x.

We were possibly supporting 3.3 before as well, this drops that. The minimum supported python is now 3.4.

I'd like to drop 3.4 too, but some distros still use it, so maybe in a few months.

@rcoup
Copy link
Member

rcoup commented May 19, 2020

This should probably go in the next minor release, i.e 0.4, rather than a 0.3.x.

👍

@rcoup
Copy link
Member

rcoup commented May 19, 2020

Can you review the 2to3 casting of iterators to list/dict?

@craigds
Copy link
Member Author

craigds commented May 19, 2020

Just realised the released version is already 0.5x, so this would go into 0.6.0

@craigds
Copy link
Member Author

craigds commented May 22, 2020

I can repro the test failures only if I run them in a -alpine or -slim container (the tests use -alpine)

if I run them in a python:3.4 container they work fine. It also seems to work sometimes if I don't clear the pytest cache, but I'm not entirely sure about it.

@craigds
Copy link
Member Author

craigds commented May 22, 2020

okay. firstly, this isn't a new issue, but since I added python 3.4/3.5 tests in buildkite, it's happening here.

The error is that the request produced by the test doesn't have a content-type header for the CSV file in the multipart upload.

I suspect that's because the -slim and -alpine variants don't have file installed, and so can't guess the mimetype of the file.

$ docker run -it --rm -v $(pwd):/app -w /app python:3.4 file --mime-type text.csv
text.csv: inode/x-empty


$ docker run -it --rm -v $(pwd):/app -w /app python:3.4-slim file --mime-type text.csv
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"file\": executable file not found in $PATH": unknown.

Maybe the mimetypes python module also uses file under the hood? It has similar behaviour:

$ docker run -it --rm -v $(pwd):/app -w /app python:3.4 python -c 'import mimetypes ; print(mimetypes.guess_type("file:///app/text.csv"))'
('text/csv', None)


$ docker run -it --rm -v $(pwd):/app -w /app python:3.4-slim python -c 'import mimetypes ; print(mimetypes.guess_type("file:///app/text.csv"))'
(None, None)

I'll make the test agnostic to this, because it doesn't really matter.

@craigds craigds merged commit 1bab3d0 into master May 24, 2020
@craigds craigds deleted the drop-py2 branch May 24, 2020 21:09
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

Successfully merging this pull request may close these issues.

Drop python 2 support
2 participants