Skip to content

Commit

Permalink
Revert "bpo-34977: Add Windows App Store package (pythonGH-10245)" (p…
Browse files Browse the repository at this point in the history
…ythonGH-11019)

This reverts commit 468a15a.
  • Loading branch information
vstinner authored Dec 7, 2018
1 parent 8452ca1 commit cb0b78a
Show file tree
Hide file tree
Showing 52 changed files with 331 additions and 3,085 deletions.
65 changes: 0 additions & 65 deletions .azure-pipelines/windows-appx-test.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

# Specific binary files
Lib/test/sndhdrdata/sndhdr.* binary
PC/classicAppCompat.* binary

# Text files that should not be subject to eol conversion
Lib/test/cjkencodings/* -text
Expand Down
2 changes: 0 additions & 2 deletions Doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@ if not exist "%BUILDDIR%" mkdir "%BUILDDIR%"

if exist ..\Misc\NEWS (
echo.Copying Misc\NEWS to build\NEWS
if not exist build mkdir build
copy ..\Misc\NEWS build\NEWS > nul
) else if exist ..\Misc\NEWS.D (
if defined BLURB (
echo.Merging Misc/NEWS with %BLURB%
if not exist build mkdir build
%BLURB% merge -f build\NEWS
) else (
echo.No Misc/NEWS file and Blurb is not available.
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ def test_resolve_common(self):
# resolves to 'dirB/..' first before resolving to parent of dirB.
self._check_resolve_relative(p, P(BASE, 'foo', 'in', 'spam'), False)
# Now create absolute symlinks
d = support._longpath(tempfile.mkdtemp(suffix='-dirD', dir=os.getcwd()))
d = support._longpath(tempfile.mkdtemp(suffix='-dirD'))
self.addCleanup(support.rmtree, d)
os.symlink(os.path.join(d), join('dirA', 'linkX'))
os.symlink(join('dirB'), os.path.join(d, 'linkY'))
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ def test_isolation(self):
self.assertIn('include-system-site-packages = %s\n' % s, data)

@unittest.skipUnless(can_symlink(), 'Needs symlinks')
@unittest.skipIf(os.name == 'nt', 'Symlinks are never used on Windows')
def test_symlinking(self):
"""
Test symlinking works as expected
Expand Down
49 changes: 30 additions & 19 deletions Lib/venv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ def create(self, env_dir):
self.system_site_packages = False
self.create_configuration(context)
self.setup_python(context)
if not self.upgrade:
self.setup_scripts(context)
if self.with_pip:
self._setup_pip(context)
if not self.upgrade:
self.setup_scripts(context)
self.post_setup(context)
if true_system_site_packages:
# We had set it to False before, now
Expand Down Expand Up @@ -159,6 +158,14 @@ def create_configuration(self, context):
f.write('include-system-site-packages = %s\n' % incl)
f.write('version = %d.%d.%d\n' % sys.version_info[:3])

if os.name == 'nt':
def include_binary(self, f):
if f.endswith(('.pyd', '.dll')):
result = True
else:
result = f.startswith('python') and f.endswith('.exe')
return result

def symlink_or_copy(self, src, dst, relative_symlinks_ok=False):
"""
Try symlinking a file, and if that fails, fall back to copying.
Expand Down Expand Up @@ -188,9 +195,9 @@ def setup_python(self, context):
binpath = context.bin_path
path = context.env_exe
copier = self.symlink_or_copy
copier(context.executable, path)
dirname = context.python_dir
if os.name != 'nt':
copier(context.executable, path)
if not os.path.islink(path):
os.chmod(path, 0o755)
for suffix in ('python', 'python3'):
Expand All @@ -202,22 +209,26 @@ def setup_python(self, context):
if not os.path.islink(path):
os.chmod(path, 0o755)
else:
# For normal cases, the venvlauncher will be copied from
# our scripts folder. For builds, we need to copy it
# manually.
if sysconfig.is_python_build(True):
suffix = '.exe'
if context.python_exe.lower().endswith('_d.exe'):
suffix = '_d.exe'

src = os.path.join(dirname, "venvlauncher" + suffix)
dst = os.path.join(binpath, context.python_exe)
copier(src, dst)

src = os.path.join(dirname, "venvwlauncher" + suffix)
dst = os.path.join(binpath, "pythonw" + suffix)
copier(src, dst)
# See bpo-34011. When using a proper install, we should only need to
# copy the top-level of DLLs.
include = self.include_binary
files = [f for f in os.listdir(dirname) if include(f)]
for f in files:
src = os.path.join(dirname, f)
dst = os.path.join(binpath, f)
if dst != context.env_exe: # already done, above
copier(src, dst)

# When creating from a build directory, we continue to copy all files.
if sysconfig.is_python_build(True):
subdir = 'DLLs'
dirname = os.path.join(dirname, subdir)
if os.path.isdir(dirname):
files = [f for f in os.listdir(dirname) if include(f)]
for f in files:
src = os.path.join(dirname, f)
dst = os.path.join(binpath, f)
copier(src, dst)
# copy init.tcl over
for root, dirs, files in os.walk(context.python_dir):
if 'init.tcl' in files:
Expand Down Expand Up @@ -315,7 +326,7 @@ def install_scripts(self, context, path):
dstfile = os.path.join(dstdir, f)
with open(srcfile, 'rb') as f:
data = f.read()
if not srcfile.endswith(('.exe', '.pdb')):
if not srcfile.endswith('.exe'):
try:
data = data.decode('utf-8')
data = self.replace_variables(data, context)
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion PC/classicAppCompat.can.xml

This file was deleted.

Binary file removed PC/classicAppCompat.cat
Binary file not shown.
28 changes: 0 additions & 28 deletions PC/classicAppCompat.sccd

This file was deleted.

8 changes: 1 addition & 7 deletions PC/getpathp.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,16 +536,10 @@ static _PyInitError
get_program_full_path(const _PyCoreConfig *core_config,
PyCalculatePath *calculate, _PyPathConfig *config)
{
const wchar_t *pyvenv_launcher;
wchar_t program_full_path[MAXPATHLEN+1];
memset(program_full_path, 0, sizeof(program_full_path));

/* The launcher may need to force the executable path to a
* different environment, so override it here. */
pyvenv_launcher = _wgetenv(L"__PYVENV_LAUNCHER__");
if (pyvenv_launcher && pyvenv_launcher[0]) {
wcscpy_s(program_full_path, MAXPATHLEN+1, pyvenv_launcher);
} else if (!GetModuleFileNameW(NULL, program_full_path, MAXPATHLEN)) {
if (!GetModuleFileNameW(NULL, program_full_path, MAXPATHLEN)) {
/* GetModuleFileName should never fail when passed NULL */
return _Py_INIT_ERR("Cannot determine program path");
}
Expand Down
Binary file removed PC/icons/pythonwx150.png
Binary file not shown.
Binary file removed PC/icons/pythonwx44.png
Binary file not shown.
Binary file removed PC/icons/pythonx150.png
Binary file not shown.
Binary file removed PC/icons/pythonx44.png
Binary file not shown.
Binary file removed PC/icons/pythonx50.png
Binary file not shown.
Loading

0 comments on commit cb0b78a

Please sign in to comment.