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

Support Python 3.10 #161

Merged
merged 2 commits into from
Oct 25, 2022
Merged

Support Python 3.10 #161

merged 2 commits into from
Oct 25, 2022

Conversation

gmarmstrong
Copy link
Contributor

Bump PySide2 to 5.15.2.1, which added support for Python 3.10.

@deeplow
Copy link
Contributor

deeplow commented Jul 18, 2022

This is also blocking support for ubuntu 22.04.

@deeplow
Copy link
Contributor

deeplow commented Aug 4, 2022

I was being blocked by a broken shiboken2 depedency on an m1 mac. Were you stuck on that as well and is that the reason why you decided to #164? @gmarmstrong

@gmarmstrong
Copy link
Contributor Author

Yep, that's right @deeplow.

@deeplow
Copy link
Contributor

deeplow commented Aug 16, 2022

@gmarmstrong not sure what was the reason for pinning the python micro version (e.g. python 3.9.9). I should not that my testing was performed on python 3.10.6 and not on the 3.10.4.

Furthermore, I tested this on an Intel mac and it works fine but on windows it has a dependency issues on windows. I have opened PRs on your branch for this.

New dependency issue on Windows

PS C:\Users\user\dangerzone> poetry install
Creating virtualenv dangerzone-HPwMvqJ7-py3.10 in C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs
Installing dependencies from lock file

Package operations: 23 installs, 0 updates, 0 removals

  • Installing colorama (0.4.4)
  • Installing altgraph (0.17.2)
  • Installing certifi (2022.5.18.1)
  • Installing charset-normalizer (2.0.12)
  • Installing cx-logging (3.0)
  • Installing click (8.1.3)
  • Installing idna (3.3)
  • Installing pathspec (0.9.0)
  • Installing mypy-extensions (0.4.3)
  • Installing platformdirs (2.5.2)
  • Installing pywin32 (304)
  • Installing shiboken2 (5.15.2.1)
  • Installing tomli (2.0.1)
  • Installing urllib3 (1.26.9)

  EnvCommandError

  Command C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\dangerzone-HPwMvqJ7-py3.10\Scripts\pip.exe install --no-deps C:\Users\user\AppData\Local\pypoetry\Cache\artifacts\ae\a3\7d\48176ffef692c3ee0966ecbc0edfc6f04ece1199869a20842c81243e31\cx_Logging-3.0.tar.gz errored with the following return code 1, and output:
  Processing c:\users\user\appdata\local\pypoetry\cache\artifacts\ae\a3\7d\48176ffef692c3ee0966ecbc0edfc6f04ece1199869a20842c81243e31\cx_logging-3.0.tar.gz
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'done'
  Building wheels for collected packages: cx-Logging
    Building wheel for cx-Logging (setup.py): started
    Building wheel for cx-Logging (setup.py): finished with status 'error'
    error: subprocess-exited-with-error

    python setup.py bdist_wheel did not run successfully.
    exit code: 1

    [7 lines of output]
    running bdist_wheel
    running build
    running build_ext
    creating build
    creating build\implib.win-amd64-3.1
    building 'cx_Logging' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for cx-Logging
    Running setup.py clean for cx-Logging
  Failed to build cx-Logging
  Installing collected packages: cx-Logging
    Running setup.py install for cx-Logging: started
    Running setup.py install for cx-Logging: finished with status 'error'
    error: subprocess-exited-with-error

    Running setup.py install for cx-Logging did not run successfully.
    exit code: 1

    [7 lines of output]
    running install
    C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\dangerzone-HPwMvqJ7-py3.10\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_ext
    building 'cx_Logging' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: legacy-install-failure

  Encountered error while trying to install package.

  cx-Logging

  note: This is an issue with the package mentioned above, not pip.
  hint: See above for output from the failure.


  at ~\AppData\Local\Programs\Python\Python310\lib\site-packages\poetry\utils\env.py:1195 in _run
      1191│                 output = subprocess.check_output(
      1192│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1193│                 )
      1194│         except CalledProcessError as e:
    → 1195│             raise EnvCommandError(e, input=input_)
      1196│
      1197│         return decode(output)
      1198│
      1199│     def execute(self, bin, *args, **kwargs):

The solution is explained in the error message: install Microsoft Visual C++ 14.0 or greater by downloading the "Microsoft C++ Build Tools" and checking the following option:
image(2)

Note: This is exclusively a dev dependency issue as is builds a .exe that can be run without this software.

@gmarmstrong
Copy link
Contributor Author

I agree with not pinning the patch version, and I'll take your word for the Windows fix. Looks good to me, merged on my end.

@deeplow
Copy link
Contributor

deeplow commented Aug 16, 2022

@gmarmstrong when you have a chance can you rebase from the main branch so we can see if the CI passes?

edit: wait. I think this is something I can do.

@deeplow
Copy link
Contributor

deeplow commented Aug 16, 2022

The CI passes (it just needed a rebase).

@deeplow deeplow added blocked and removed blocked labels Aug 17, 2022
@deeplow deeplow force-pushed the py310 branch 2 times, most recently from 58aee46 to 4ec0b76 Compare September 14, 2022 13:00
@deeplow
Copy link
Contributor

deeplow commented Sep 14, 2022

I have rebased this now

@deeplow
Copy link
Contributor

deeplow commented Sep 14, 2022

Just testing this again on a Windows and MacOS before merging.

@deeplow
Copy link
Contributor

deeplow commented Sep 14, 2022

Update: turns out this was an issue with poetry and not python3.10
I am getting stuck on installing this on windows again with python3.10. I'll debug this at a later date:

PS C:\Users\user\dangerzone> poetry run .\install\windows\build-image.py

  OSError

  [WinError 193] %1 is not a valid Win32 application

  at ~\AppData\Local\Programs\Python\Python310\lib\subprocess.py:1438 in _execute_child
      1434│             sys.audit("subprocess.Popen", executable, args, cwd, env)
      1435│
      1436│             # Start the process
      1437│             try:
    → 1438│                 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
      1439│                                          # no special security
      1440│                                          None, None,
      1441│                                          int(not close_fds),
      1442│                                          creationflags,

@eloquence eloquence added this to the 0.4.0 milestone Sep 15, 2022
@deeplow
Copy link
Contributor

deeplow commented Oct 21, 2022

Ready to be merged @apyrgio do you have your OK?

@apyrgio
Copy link
Contributor

apyrgio commented Oct 21, 2022

The changes look good to me. I haven't tested it on Windows though. If you haven't, I can check it out on Monday.

gmarmstrong and others added 2 commits October 25, 2022 10:23
PySide2 5.15.2.1 added support for Python 3.10
On a windows system when running `pip install` it fails to install
`cx_Logging-3.0` with the error:

    error: Microsoft Visual C++ 14.0 or greater is required. Get it
    with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

Installing this dependency solves the issue.
@deeplow
Copy link
Contributor

deeplow commented Oct 26, 2022

We might have moved too soon with this. Apparently some machines in the CI don't yet have python 3.10. https://app.circleci.com/pipelines/github/freedomofpress/dangerzone/508/workflows/babd9a00-4a5e-47c7-b820-97b1f2270c87/jobs/2276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants