• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 16296330002

15 Jul 2025 02:37PM UTC coverage: 68.497% (+0.05%) from 68.446%
16296330002

Pull #1409

github

web-flow
Merge f2c4efc30 into ab7eb024e
Pull Request #1409: Add Python Scripts folder to PATH on Windows

3292 of 5210 branches covered (63.19%)

Branch coverage included in aggregate %.

8423 of 11893 relevant lines covered (70.82%)

3.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
cli/src/main/java/com/devonfw/tools/ide/tool/python/Python.java
1
package com.devonfw.tools.ide.tool.python;
2

3
import java.nio.file.Files;
4
import java.nio.file.Path;
5
import java.util.Set;
6

7
import com.devonfw.tools.ide.common.Tag;
8
import com.devonfw.tools.ide.context.IdeContext;
9
import com.devonfw.tools.ide.nls.NlsBundle;
10
import com.devonfw.tools.ide.tool.LocalToolCommandlet;
11
import com.devonfw.tools.ide.tool.ToolCommandlet;
12

13
/**
14
 * {@link ToolCommandlet} for <a href="https://www.python.org/">python</a>.
15
 */
16
public class Python extends LocalToolCommandlet {
17

18
  /**
19
   * The constructor.
20
   *
21
   * @param context the {@link IdeContext}.
22
   */
23
  public Python(IdeContext context) {
24

25
    super(context, "python", Set.of(Tag.PYTHON));
6✔
26
  }
1✔
27

28
  @Override
29
  public void postInstall() {
30

31
    super.postInstall();
2✔
32
    
33
    // Only on Windows: create symlinks to make Scripts folder accessible via bin
34
    if (this.context.getSystemInfo().isWindows()) {
5✔
35
      Path toolPath = getToolPath();
3✔
36
      Path scriptsPath = toolPath.resolve("Scripts");
4✔
37
      
38
      // Check if Scripts folder exists (typical Python Windows installation)
39
      if (Files.isDirectory(scriptsPath)) {
5!
40
        // Create bin folder as symlink to Scripts so SystemPath finds it
41
        Path binPath = toolPath.resolve("bin");
4✔
42
        this.context.getFileAccess().symlink(scriptsPath, binPath);
6✔
43
        
44
        // Create python.exe link in Scripts folder pointing to main python.exe
45
        Path mainPythonExe = toolPath.resolve("python.exe");
4✔
46
        if (Files.exists(mainPythonExe)) {
5!
47
          Path scriptsPythonExe = scriptsPath.resolve("python.exe");
4✔
48
          if (!Files.exists(scriptsPythonExe)) {
5!
49
            this.context.getFileAccess().symlink(Path.of("../python.exe"), scriptsPythonExe);
9✔
50
          }
51
        }
52
      }
53
    }
54
  }
1✔
55

56
  @Override
57
  protected boolean isIgnoreSoftwareRepo() {
58

59
    return true;
×
60
  }
61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc