- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
pyinstaller support added to PipEnv #19030
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
          
     Merged
      
      
            czoido
  merged 15 commits into
  conan-io:develop2
from
davidsanfal:feature/pyinstaller-venv
  
      
      
   
  Oct 29, 2025 
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            15 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      57efa02
              
                pyinstaller support added to PipEnv
              
              
                davidsanfal ee7e38a
              
                wip
              
              
                davidsanfal ce2fe4e
              
                wip
              
              
                davidsanfal 4f03d6e
              
                wip
              
              
                davidsanfal 79b2235
              
                wip
              
              
                davidsanfal 354b647
              
                wip
              
              
                davidsanfal 42ff5cb
              
                wip
              
              
                davidsanfal 42aa371
              
                wip
              
              
                davidsanfal 5425e09
              
                wip
              
              
                davidsanfal aa63728
              
                new test added
              
              
                davidsanfal 4a1d10e
              
                _default_python method added
              
              
                davidsanfal 8df2e5c
              
                wip
              
              
                davidsanfal 67fadfb
              
                wip
              
              
                davidsanfal 31f3c53
              
                wip
              
              
                davidsanfal 5c8438e
              
                wip
              
              
                davidsanfal File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
          Some comments aren't visible on the classic Files Changed page.
        
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| from conan.tools.system import PipEnv | ||
| from unittest.mock import patch | ||
| import pytest | ||
| from conan.errors import ConanException | ||
| from conan.internal.model.settings import Settings | ||
| from conan.test.utils.mocks import ConanFileMock | ||
|  | ||
|  | ||
| @patch('shutil.which') | ||
| def test_pipenv_conf(mock_shutil_which): | ||
| conanfile = ConanFileMock() | ||
| conanfile.settings = Settings() | ||
| conanfile.conf.define("tools.system.pipenv:python_interpreter", "/python/interpreter/from/config") | ||
| result = "/python/interpreter/from/config -m venv" | ||
| pipenv = PipEnv(conanfile, "testenv") | ||
|  | ||
| def fake_run(command, win_bash=False, subsystem=None, env=None, ignore_errors=False, quiet=False): | ||
| assert result in command | ||
| return 100 | ||
| conanfile.run = fake_run | ||
| pipenv._create_venv() | ||
| mock_shutil_which.assert_not_called() | ||
|  | ||
|  | ||
| @patch('shutil.which') | ||
| def test_pipenv_error_message(mock_shutil_which): | ||
| conanfile = ConanFileMock() | ||
| conanfile.settings = Settings() | ||
| mock_shutil_which.return_value = None | ||
| with pytest.raises(ConanException) as exc_info: | ||
| pipenv = PipEnv(conanfile, "testenv") | ||
| pipenv._create_venv() | ||
| assert "install Python system-wide or set the 'tools.system.pipenv:python_interpreter' conf" in exc_info.value.args[0] | ||
|  | ||
|  | ||
| def test_pipenv_creation_error_message(): | ||
| conanfile = ConanFileMock() | ||
| conanfile.settings = Settings() | ||
| conanfile.conf.define("tools.system.pipenv:python_interpreter", "/python/interpreter/from/config") | ||
| pipenv = PipEnv(conanfile, "testenv") | ||
|  | ||
| def fake_run(command, win_bash=False, subsystem=None, env=None, ignore_errors=False, quiet=False): | ||
| raise ConanException("fake error message") | ||
| conanfile.run = fake_run | ||
| with pytest.raises(ConanException) as exc_info: | ||
| pipenv._create_venv() | ||
| assert "using '/python/interpreter/from/config': fake error message" in exc_info.value.args[0] | 
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.