diff --git a/python/python-core-impl/src/com/jetbrains/python/PythonStringUtil.java b/python/python-core-impl/src/com/jetbrains/python/PythonStringUtil.java index 8f98e60f64cb..0a84d86254fd 100644 --- a/python/python-core-impl/src/com/jetbrains/python/PythonStringUtil.java +++ b/python/python-core-impl/src/com/jetbrains/python/PythonStringUtil.java @@ -15,8 +15,6 @@ import org.jetbrains.annotations.Nullable; import java.util.List; import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** * @author Alexei Orischenko @@ -65,15 +63,6 @@ public final class PythonStringUtil { return false; } - public static boolean isEmail(String s) { - if (!StringUtil.isEmpty(s)) { - Pattern p = Pattern.compile("^[\\w\\.-]+@([\\w\\-]+\\.)+[a-z]{2,4}$"); - Matcher m = p.matcher(s); - return m.matches(); - } - return false; - } - public static @NotNull String getFirstPrefix(String s, String separator) { if (s != null) { int pos = s.indexOf(separator); diff --git a/python/python-core-impl/src/com/jetbrains/python/psi/FileReferenceWithOneContext.java b/python/python-core-impl/src/com/jetbrains/python/psi/FileReferenceWithOneContext.java index 27a64b10dde0..1c5f8299a985 100644 --- a/python/python-core-impl/src/com/jetbrains/python/psi/FileReferenceWithOneContext.java +++ b/python/python-core-impl/src/com/jetbrains/python/psi/FileReferenceWithOneContext.java @@ -42,10 +42,6 @@ public class FileReferenceWithOneContext extends FileReference { super(fileReferenceSet, range, index, text); } - public FileReferenceWithOneContext(FileReference original) { - super(original); - } - @Override protected Collection getContextsForBindToElement(VirtualFile curVFile, Project project, FileReferenceHelper helper) { return getContexts(); diff --git a/python/python-psi-api/src/com/jetbrains/python/psi/impl/PyPsiUtils.java b/python/python-psi-api/src/com/jetbrains/python/psi/impl/PyPsiUtils.java index 0a5814a74817..9137bd2e58d0 100644 --- a/python/python-psi-api/src/com/jetbrains/python/psi/impl/PyPsiUtils.java +++ b/python/python-psi-api/src/com/jetbrains/python/psi/impl/PyPsiUtils.java @@ -199,14 +199,6 @@ public final class PyPsiUtils { return PyPsiUtilsCore.getChildByFilter(element, filter, number); } - public static void addBeforeInParent(final @NotNull PsiElement anchor, final PsiElement @NotNull ... newElements) { - final ASTNode anchorNode = anchor.getNode(); - LOG.assertTrue(anchorNode != null); - for (PsiElement newElement : newElements) { - anchorNode.getTreeParent().addChild(newElement.getNode(), anchorNode); - } - } - public static void removeElements(final PsiElement @NotNull ... elements) { final ASTNode parentNode = elements[0].getParent().getNode(); LOG.assertTrue(parentNode != null); diff --git a/python/python-psi-api/src/com/jetbrains/python/psi/impl/StubAwareComputation.java b/python/python-psi-api/src/com/jetbrains/python/psi/impl/StubAwareComputation.java index 47642adbe4b0..54c6b62a2b77 100644 --- a/python/python-psi-api/src/com/jetbrains/python/psi/impl/StubAwareComputation.java +++ b/python/python-psi-api/src/com/jetbrains/python/psi/impl/StubAwareComputation.java @@ -127,13 +127,6 @@ public final class StubAwareComputation StubAwareComputation overAst(@NotNull Function astComputation) { return new StubAwareComputation<>(this, null, astComputation, null, null); } - - /** - * @see StubAwareComputation#overAstStubLike(Function) - */ - public @NotNull StubAwareComputation overAstStubLike(@NotNull Function astStubLikeComputation) { - return new StubAwareComputation<>(this, null, null, astStubLikeComputation, null); - } } private final @NotNull PsiToStubConversion myConversion; diff --git a/python/python-psi-impl/src/com/jetbrains/python/sdk/PythonEnvUtil.java b/python/python-psi-impl/src/com/jetbrains/python/sdk/PythonEnvUtil.java index 8ad8c874db41..59ebad86a914 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/sdk/PythonEnvUtil.java +++ b/python/python-psi-impl/src/com/jetbrains/python/sdk/PythonEnvUtil.java @@ -108,14 +108,6 @@ public final class PythonEnvUtil { addPathToEnv(env, PYTHONPATH, value); } - public static void mergePythonPath(@NotNull Map from, @NotNull Map to) { - String value = from.get(PYTHONPATH); - if (value != null) { - Set paths = Sets.newHashSet(value.split(File.pathSeparator)); - addToPythonPath(to, paths); - } - } - public static @NotNull Map setPythonDontWriteBytecode(@NotNull Map env) { env.put(PYTHONDONTWRITEBYTECODE, "1"); return env; diff --git a/python/src/com/jetbrains/python/module/PyModuleServiceEx.java b/python/src/com/jetbrains/python/module/PyModuleServiceEx.java index f77f39913aa5..ddc8fb453223 100644 --- a/python/src/com/jetbrains/python/module/PyModuleServiceEx.java +++ b/python/src/com/jetbrains/python/module/PyModuleServiceEx.java @@ -1,17 +1,5 @@ // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.module; -import com.intellij.ide.util.projectWizard.ModuleBuilder; -import com.intellij.platform.DirectoryProjectGenerator; - public abstract class PyModuleServiceEx extends PyModuleService { - /** - * Creates a ModuleBuilder that creates a Python module and runs the specified DirectoryProjectGenerator to perform - * further initialization. The showGenerationSettings() method on the generator is not called, and the generateProject() method - * receives null as the 'settings' parameter. - * - * @param generator the generator to run for configuring the project - * @return the created module builder instance - */ - public abstract ModuleBuilder createPythonModuleBuilder(DirectoryProjectGenerator generator); } diff --git a/python/src/com/jetbrains/python/module/PyModuleServiceImpl.java b/python/src/com/jetbrains/python/module/PyModuleServiceImpl.java index cedce0ece36b..2788610778a4 100644 --- a/python/src/com/jetbrains/python/module/PyModuleServiceImpl.java +++ b/python/src/com/jetbrains/python/module/PyModuleServiceImpl.java @@ -4,22 +4,16 @@ package com.jetbrains.python.module; import com.intellij.facet.Facet; import com.intellij.facet.FacetConfiguration; import com.intellij.facet.FacetManager; -import com.intellij.ide.util.projectWizard.ModuleBuilder; import com.intellij.openapi.fileTypes.FileTypeManager; import com.intellij.openapi.module.Module; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.platform.DirectoryProjectGenerator; import com.intellij.util.Consumer; import com.jetbrains.python.facet.PythonFacetSettings; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; final class PyModuleServiceImpl extends PyModuleServiceEx { - @Override - public ModuleBuilder createPythonModuleBuilder(DirectoryProjectGenerator generator) { - return new PythonModuleBuilderBase(generator); - } @Override public boolean isFileIgnored(@NotNull VirtualFile file) { diff --git a/python/src/com/jetbrains/python/namespacePackages/PyNamespacePackagesService.java b/python/src/com/jetbrains/python/namespacePackages/PyNamespacePackagesService.java index 1b14bab5a747..9c9ed24cffd2 100644 --- a/python/src/com/jetbrains/python/namespacePackages/PyNamespacePackagesService.java +++ b/python/src/com/jetbrains/python/namespacePackages/PyNamespacePackagesService.java @@ -45,11 +45,6 @@ public final class PyNamespacePackagesService implements PersistentStateComponen return module.getService(PyNamespacePackagesService.class); } - public @NotNull List getNamespacePackageFolders() { - removeInvalidNamespacePackageFolders(); - return Collections.unmodifiableList(myTools.getFoldersAsStrings()); - } - @Transient public @NotNull List getNamespacePackageFoldersVirtualFiles() { removeInvalidNamespacePackageFolders(); diff --git a/python/src/com/jetbrains/python/newProject/PythonProjectGenerator.java b/python/src/com/jetbrains/python/newProject/PythonProjectGenerator.java index a63cb610ff61..c687843170d1 100644 --- a/python/src/com/jetbrains/python/newProject/PythonProjectGenerator.java +++ b/python/src/com/jetbrains/python/newProject/PythonProjectGenerator.java @@ -259,12 +259,6 @@ public abstract class PythonProjectGenerator ext void stateChanged(); } - public void fireStateChanged() { - for (SettingsListener listener : myListeners) { - listener.stateChanged(); - } - } - public void afterProjectGenerated(final @NotNull Project project) { } diff --git a/python/src/com/jetbrains/python/newProject/steps/ProjectSpecificSettingsStep.java b/python/src/com/jetbrains/python/newProject/steps/ProjectSpecificSettingsStep.java index de3cb3256047..b8e0d980ede0 100644 --- a/python/src/com/jetbrains/python/newProject/steps/ProjectSpecificSettingsStep.java +++ b/python/src/com/jetbrains/python/newProject/steps/ProjectSpecificSettingsStep.java @@ -3,11 +3,9 @@ package com.jetbrains.python.newProject.steps; import com.intellij.execution.target.TargetEnvironmentConfiguration; import com.intellij.facet.ui.ValidationResult; -import com.intellij.ide.impl.ProjectUtil; import com.intellij.ide.util.projectWizard.AbstractNewProjectStep; import com.intellij.ide.util.projectWizard.ProjectSettingsStepBase; import com.intellij.ide.util.projectWizard.WebProjectTemplate; -import com.intellij.openapi.application.PathManager; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.ui.LabeledComponent; @@ -21,8 +19,6 @@ import com.intellij.platform.DirectoryProjectGenerator; import com.intellij.ui.HideableDecorator; import com.intellij.util.ObjectUtils; import com.intellij.util.PathUtil; -import com.intellij.util.PlatformUtils; -import com.intellij.util.concurrency.annotations.RequiresEdt; import com.jetbrains.python.PyBundle; import com.jetbrains.python.configuration.PyConfigurableInterpreterList; import com.jetbrains.python.newProject.PyFrameworkProjectGenerator; @@ -43,7 +39,6 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; import java.io.File; -import java.nio.file.Path; import java.util.*; import java.util.List; import java.util.stream.Collectors; @@ -116,10 +111,6 @@ public class ProjectSpecificSettingsStep extends return interpreterPanel.getSdk(); } - public boolean installFramework() { - return myInstallFramework; - } - @Override protected void registerValidators() { super.registerValidators(); @@ -348,20 +339,4 @@ public class ProjectSpecificSettingsStep extends .sorted(new PreferredSdkComparator()) .toList(); } - - /** - * If {@link PythonProjectGenerator} {@link PythonProjectGenerator#supportsWelcomeScript()}, - * {@link ProjectSpecificSettingsStep} and inheritors should ask use if one should be created, and return true if so. - */ - @RequiresEdt - public boolean createWelcomeScript() { - return false; - } - - private static @NotNull File getBaseDir() { - if (PlatformUtils.isDataSpell() && Path.of(ProjectUtil.getBaseDir()).startsWith(PathManager.getConfigDir())) { - return new File(ProjectUtil.getUserHomeProjectDir()); - } - return new File(ProjectUtil.getBaseDir()); - } } diff --git a/python/src/com/jetbrains/python/newProject/steps/PythonProjectSpecificSettingsStep.kt b/python/src/com/jetbrains/python/newProject/steps/PythonProjectSpecificSettingsStep.kt index 9e50246265a5..793d9086c42f 100644 --- a/python/src/com/jetbrains/python/newProject/steps/PythonProjectSpecificSettingsStep.kt +++ b/python/src/com/jetbrains/python/newProject/steps/PythonProjectSpecificSettingsStep.kt @@ -25,7 +25,6 @@ import com.intellij.ui.dsl.builder.Align import com.intellij.ui.dsl.builder.bindSelected import com.intellij.ui.dsl.builder.bindText import com.intellij.ui.dsl.builder.panel -import com.intellij.util.concurrency.annotations.RequiresEdt import com.jetbrains.python.PyBundle.message import com.jetbrains.python.newProject.PyNewProjectSettings import com.jetbrains.python.newProject.PythonProjectGenerator @@ -79,9 +78,6 @@ class PythonProjectSpecificSettingsStep( return createContentPanelWithAdvancedSettingsPanel() } - @RequiresEdt - override fun createWelcomeScript(): Boolean = createScript.get() - /** * Returns the project location that is either: * - constructed using two parts (using the values from "Location" and "Name" fields) for Python project types ("Pure Python", "Django", @@ -180,10 +176,6 @@ class PythonProjectSpecificSettingsStep( } } - override fun installFramework(): Boolean { - return true - } - override fun onPanelSelected() { interpreterPanel?.onShown() } diff --git a/python/src/com/jetbrains/python/packaging/PyAbstractPackageCache.java b/python/src/com/jetbrains/python/packaging/PyAbstractPackageCache.java index dd571f81e3bc..60678a81ca19 100644 --- a/python/src/com/jetbrains/python/packaging/PyAbstractPackageCache.java +++ b/python/src/com/jetbrains/python/packaging/PyAbstractPackageCache.java @@ -123,18 +123,6 @@ public abstract class PyAbstractPackageCache { return myPackages.containsKey(name); } - /** - * Returns available package versions sorted in the reversed order using - * {@link com.intellij.webcore.packaging.PackageVersionComparator} so that the latest version is the first on the list - * or {@code null} if the given package is not contained in the cache or this feature is not available. - * - * @param packageName case-insensitive name of a package - */ - public @Nullable List getVersions(@NotNull String packageName) { - final PackageInfo packageInfo = myPackages.get(packageName); - return packageInfo != null ? packageInfo.getVersions() : null; - } - @Override public String toString() { return String.format("%s(size=%d): %s...", getClass().getSimpleName(), myPackages.size(), diff --git a/python/src/com/jetbrains/python/packaging/PyCondaPackageManagerImpl.java b/python/src/com/jetbrains/python/packaging/PyCondaPackageManagerImpl.java index 3999eba98ddf..090ad34e4ed8 100644 --- a/python/src/com/jetbrains/python/packaging/PyCondaPackageManagerImpl.java +++ b/python/src/com/jetbrains/python/packaging/PyCondaPackageManagerImpl.java @@ -24,14 +24,6 @@ public class PyCondaPackageManagerImpl extends PyPackageManagerImpl { public static final String PYTHON = "python"; public boolean useConda = true; - public boolean useConda() { - return useConda; - } - - public void useConda(boolean conda) { - useConda = conda; - } - PyCondaPackageManagerImpl(final @NotNull Sdk sdk) { super(sdk); } diff --git a/python/src/com/jetbrains/python/packaging/ui/PyPackageManagementService.java b/python/src/com/jetbrains/python/packaging/ui/PyPackageManagementService.java index 7518f51073ea..3d7ed4389733 100644 --- a/python/src/com/jetbrains/python/packaging/ui/PyPackageManagementService.java +++ b/python/src/com/jetbrains/python/packaging/ui/PyPackageManagementService.java @@ -128,16 +128,6 @@ public class PyPackageManagementService extends PackageManagementServiceEx { return result; } - public Map> getAllPackagesByRepository() { - Map> result = new HashMap<>(); - result.put(PyPIPackageUtil.PYPI_LIST_URL, getCachedPyPIPackages()); - List repositories = getAdditionalRepositories(); - for (String repo : repositories) { - result.put(repo, PyPIPackageUtil.INSTANCE.getAdditionalPackages(List.of(repo))); - } - return result; - } - private static @NotNull List getAdditionalRepositories() { return PyPackageService.getInstance().additionalRepositories; }