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

Delete DOS-only PC/testpy.py #94419

Merged
merged 3 commits into from Jun 30, 2022
Merged

Delete DOS-only PC/testpy.py #94419

merged 3 commits into from Jun 30, 2022

Conversation

arhadthedev
Copy link
Contributor

@arhadthedev arhadthedev commented Jun 29, 2022

  1. On Windows, python PC\testpy.py prints the following error:

    Could not import the standard "symbol" module.  If this is
      a PC, you should add the dos_8x3 directory to your PYTHONPATH.
    
  2. According to the script source code, it would then call test.libregrtest.main. However, we have a dedicated python -m test runner with lots of parameters for such a purpose.

@ambv
Copy link
Contributor

@ambv ambv commented Jun 29, 2022

arm and win32 report

D:\a\1\s\Modules\_hashopenssl.c(33,10): fatal error C1083: Cannot open include file: 'openssl/evp.h': No such file or directory

which doesn't seem related but it would still be better to have everything green to check in a file deletion. Let me update the branch.

@ambv
Copy link
Contributor

@ambv ambv commented Jun 29, 2022

OK, this is now passing. I'll leave this PR open for the next day or so, maybe @zooba has a comment before we remove the file.

@zooba
Copy link
Member

@zooba zooba commented Jun 29, 2022

This is fine, but are there any other files to be removed from the PC directory? No point doing a single PR for each one if they're this uncontroversial.

@arhadthedev
Copy link
Contributor Author

@arhadthedev arhadthedev commented Jun 30, 2022

are there any other files to be removed from the PC directory

There are files mentioned nowhere in python/cpython (git grep filename.ext gives empty output). However, I don't know which ones are used by outside scripts and release managers, and which ones are abandoned and can be removed.

  • PC/classicAppCompat.can.xml
  • PC/classicAppCompat.cat
  • PC/icons/launcher.icns
  • PC/icons/py.icns
  • PC/icons/pyc.icns
  • PC/icons/pyd.icns
  • PC/icons/python.icns
  • PC/icons/pythonw.icns
  • PC/icons/setup.icns
  • PC/layout/support/appxmanifest.py
  • PC/layout/support/catalog.py
  • PC/layout/support/filesets.py
  • PC/layout/support/nuspec.py
  • PC/layout/support/props.py

The only thing I know is that the following files must be kept:

  • PC/icons/*.svg (high quality sources)
  • PC/store_info.txt (a kind of README)

JFYI, the list is generated with ..\python.bat ..\find_unused.py > 1.txt where find_unused.py is the following:

from os.path import basename
from subprocess import run
from sys import stderr

lstree = ('git', 'ls-tree', '-r', '--name-only', 'HEAD')
lstree_result = run(lstree, capture_output=True, check=True, text=True)
tracked_files = lstree_result.stdout.splitlines()

for file_path in tracked_files:
    print(file_path, file=stderr)
    file_name = basename(file_path)
    grep_result = run(['git', 'grep', '-q', file_name, '--', ':/'])
    found_no_usage = grep_result.returncode != 0
    if found_no_usage:
        print(f'- {file_path}')

@arhadthedev
Copy link
Contributor Author

@arhadthedev arhadthedev commented Jun 30, 2022

@pablogsal Are PC/icons/*.icns and PC/classicAppCompat.* used to build Python 3.12 installers? If no, can they be safely deleted?

@zooba
Copy link
Member

@zooba zooba commented Jun 30, 2022

You need to fix that script, because those files are definitely used ;-)

The *.icns ones are the macOS versions of those icons, which we kept for the day that the icons are aligned between releases. They're probably genuinely not referenced anywhere.

All the rest are part of the PC/layout script, and are essential. So this tells me there's nothing left to clean up and I can merge this PR, thanks!

@zooba zooba merged commit 9ef50c1 into python:main Jun 30, 2022
12 checks passed
@arhadthedev arhadthedev deleted the pc-testpy branch Jun 30, 2022
gvanrossum pushed a commit to gvanrossum/cpython that referenced this issue Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants