Add Python 3.12 to the test suite#764
Conversation
| | {"COM%d" % i for i in range(1, 10)} | ||
| | {"LPT%d" % i for i in range(1, 10)} | ||
| ) | ||
| pathmod = ntpath |
There was a problem hiding this comment.
This class attribute was present but seemingly unused before python/cpython#95450
| self.assertTrue(path.is_symlink()) | ||
|
|
||
| @unittest.skipIf(sys.version_info < (3, 8), "link_to new in Python 3.8") | ||
| @unittest.skipIf(sys.version_info >= (3, 12), "link_to removed in Python 3.12") |
There was a problem hiding this comment.
There was a problem hiding this comment.
Yes, this had been deprecated before (actually renamed to hardlink_to).
|
The Windows tests are failing because of this new feature that was added: python/cpython#99548
|
13d6c7a to
887d6b0
Compare
mrbean-bremen
left a comment
There was a problem hiding this comment.
Thank you for that, this is helpful! If you will exclude the extra requirement tests for Python 3.12, and add a release note (under Infrastructure), I will happily merge this.
| @property | ||
| def is_junction(self) -> bool: | ||
| # TODO: implement junctions | ||
| return False |
There was a problem hiding this comment.
This should probably return `self.filesystem.is_junction(self.path).
| experimental: true | ||
| - os: windows-latest | ||
| python-version: "3.12-dev" | ||
| experimental: true |
There was a problem hiding this comment.
I would probably just disable the tests with extra requirements for 3.12 (by adding a version check to the respective steps). It is common that larger packages do not support a new Python in early development stages. We can remove the check later.
| TypeError: if path is None. | ||
| """ | ||
| # TODO: implement junction on Windows | ||
| return False |
There was a problem hiding this comment.
I think for the time being it is ok to just return False here - I would adapt the description accordingly, though. Later, we may add some convenience function to make a junction in pyfakefs - as far as I can see, this is not possible in Python yet. We also need to adapt os.stat, os.lstat and possibly other functions that will support junctions.
| self.assertTrue(path.is_symlink()) | ||
|
|
||
| @unittest.skipIf(sys.version_info < (3, 8), "link_to new in Python 3.8") | ||
| @unittest.skipIf(sys.version_info >= (3, 12), "link_to removed in Python 3.12") |
There was a problem hiding this comment.
Yes, this had been deprecated before (actually renamed to hardlink_to).
|
I'll do that tomorrow |
| TypeError: if path is None. | ||
| """ | ||
| # TODO: implement junction on Windows | ||
| """Junction are never faked.""" |
There was a problem hiding this comment.
Typo: Junction -> Junctions.
You may also add something like "Returns False - junctions are never faked."
| shell: bash | ||
| - name: Install extra dependencies | ||
| if: ${{ ! matrix.experimental }} | ||
| if: ${{ python-version == "3.12-dev" }} |
There was a problem hiding this comment.
The string literal must be written using single quotes: https://docs.github.com/en/actions/learn-github-actions/expressions#literals
17c9017 to
f1b954b
Compare
|
Do I need to update the documentation anywhere? |
No, there is no need. The API documentation is automatically generated, and at this stage I wouldn't announce support for Python 3.12 yet. |
Yes, I noticed that the new methods I've added aren't showing up because of the conditionals I added here since the docs aren't generated using Python 3.12. It's probably fine for now, but something to keep in mind when official support is added. |
|
Good point, I wasn't aware of this. |
Describe the changes
I know this is quite early 😄 but I was trying to test one of my packages to see if it worked and noticed that pyfakefs was returning some errors. I fixed a few issues to make it work on my machine (macOS) but it looks like it now fails due to pandas not installing yet. Also Windows fails but I don't have such a machine, so I might not be the best person to fix these...
Let me know how I should proceed with this. I understand if you want to close or leave this pull request open until all the jobs pass. I'm also happy to split the fixes and leave the CI updates out for now.
However, I do think that having basic support in this package might help others packages to add Python 3.12 compatibility.
Tasks