GitHub's language-detection has its own rather lengthy README.md file that you will also see below the contents of the repository itself. As it notes, it can detect multiple different languages and display them:

but:
Linguist ... excludes all ... vendored code
and by writing:
* linguist-vendored
you have directed it to ignore all files. Your subsequent directive of:
*.py linguist-vendored=false
overrides this directive specifically for *.py
files, allowing them to be classified.
The odd thing is that you bothered to add a .gitattributes
at all. You need only do this if you must hide files or override the automated detection. What you did was hide all non-*.py
files, so you are applying automated detection (not an explicit language override) for files that do match the *.py
pattern.
You should also make particular note of their remarks that:
When you push changes to a repository on GitHub.com, a low priority background job is enqueued to analyze your repository as explained above. The results of this analysis are cached for the lifetime of your repository and are only updated when the repository is updated. As this analysis is performed by a low priority background job, it can take a while, particularly during busy periods, for your language statistics bar to reflect your changes.
(emphasis mine)