Skip to content

Commit

Permalink
0.3.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
s-m-e committed Nov 24, 2021
2 parents 9c51756 + 010eee9 commit 03f6704
Show file tree
Hide file tree
Showing 48 changed files with 2,682 additions and 1,510 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: wenv test suite

on:
push: {}
schedule:
- cron: '30 9 7 * *'

jobs:
build:

strategy:
matrix:
os: ["ubuntu-18.04", "ubuntu-20.04"]
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Install Wine
run: |
sudo dpkg --add-architecture i386
wget https://dl.winehq.org/wine-builds/Release.key
sudo apt-key add Release.key
wget https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
sudo apt-add-repository 'https://dl.winehq.org/wine-builds/ubuntu/'
sudo apt-get -qq update
sudo apt-get install -y wine-staging
echo "/opt/wine-staging/bin" >> $GITHUB_PATH
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Update Python infrastructure
run: |
python -m pip install --upgrade pip
pip install -U setuptools
- name: Install wenv package
run: |
make install
- name: Pre-check
run: |
wine --version
wine64 --version
python --version
pytest --version
uname -a
lsb_release -a
wenv --version
- name: Build docs
run: |
make docs
- name: Run tests
run: |
make test
9 changes: 9 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2

python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- dev
82 changes: 0 additions & 82 deletions .travis.yml

This file was deleted.

20 changes: 19 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changes

## 0.3.0 (2021-11-24)

- FEATURE: Added support for Python 3.9 and 3.10.
- FEATURE: Dropped support for Python 3.4 and 3.5.
- FEATURE: Exposed parser for CPython versions, see `wenv.PythonVersion`.
- FEATURE: New functions for querying available Windows Embeddable Python builds from [python.org/downloads](https://www.python.org/downloads/), see `wenv.get_available_python_builds` and `wenv.get_latest_python_build`.
- FEATURE: Experimental support for ARM64 added.
- FEATURE: New command for showing wenv's version: ``wenv version``
- FIX: Wine Python can distinctly refer to and handle alpha, beta, release-candidate and stable builds of CPython.
- FIX: Error handling in package listing for Wine Python environments was broken.
- FIX: Python version parser could not handle Windows ARM64 builds.
- FIX: Configuration expected in `/etc/.wenv.json` and `/etc/wenv.json`, see #15. The support for `/etc/.wenv.json` will be removed in a future release.
- FIX: The names of wine binaries/commands can be configured for special cases like RedHat/Fedora/CentOS wine packages, see zugbruecke#70.
- FIX: Configuration module, `wenv.EnvConfig`, is now properly documented and actually usable from outside `wenv`.
- DOCS: Hugely improved.
- DEV: New `makefile` structure for developers.
- DEV: Switched from unsupported `python-language-server` to supported `python-lsp-server`.

## 0.2.1 (2020-07-10)

- FIX: CI tests failed due to dependency issue in Python 3.4, see issue #13.
Expand Down Expand Up @@ -45,7 +63,7 @@ Wine 2.x and 3.x are no longer supported. Please use Wine 4.x or later.

On older versions of Linux such as *Ubuntu 14.04* alias *Trusty Tahr* (released 2014), you may observe errors when running ``wenv python``. Most commonly, they will present themselves as ``OSError: [WinError 6] Invalid handle: 'z:\\...`` triggered by calling ``os.listdir`` on a symbolic link ("symlink") to a folder.

*wenv* will use semantic versioning. Breaking changes will be indicated by increasing the first version number, the major version. Going for example from 0.x.0 to 1.0.0 or going from 1.y.0 to 2.0.0 therefore indicates a breaking change.
*wenv* will use semantic versioning. Breaking changes will be indicated by increasing the first version number, the major version. Going for example from 0.0.x to 0.1.y or going from 0.1.x to 0.2.y therefore indicates a breaking change.

* FEATURE: Allow `-h` and `--help` as alternatives to `help`.
* FEATURE: ``wineprefix``, ``winedebug`` and ``pythonprefix`` become configuration parameters definable by users allowing custom wine prefixes, wine debug levels and Python installation paths, see issue zugbruecke#44.
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[![build_master](https://img.shields.io/travis/pleiszenburg/wenv/master.svg?style=flat-square "Build Status: master / release")](https://travis-ci.org/pleiszenburg/wenv)
![wenv](http://www.pleiszenburg.de/wenv_logo.png)

# wenv - Running Python on Wine

[![build_master](https://github.com/pleiszenburg/wenv/actions/workflows/test.yaml/badge.svg?branch=master "Build Status: master / release")](https://github.com/pleiszenburg/wenv/actions/workflows/test.yaml)
[![docs_master](https://readthedocs.org/projects/wenv/badge/?version=latest&style=flat-square "Documentation Status: master / release")](https://wenv.readthedocs.io/en/latest/)
[![build_develop](https://img.shields.io/travis/pleiszenburg/wenv/develop.svg?style=flat-square "Build Status: development branch")](https://travis-ci.org/pleiszenburg/wenv)
[![docs_develop](https://readthedocs.org/projects/wenv/badge/?version=develop&style=flat-square "Documentation Status: development branch")](https://wenv.readthedocs.io/en/develop/)
[![license](https://img.shields.io/pypi/l/wenv.svg?style=flat-square "Internet Systems Consortium License")](https://github.com/pleiszenburg/wenv/blob/master/LICENSE)
[![license](https://img.shields.io/pypi/l/wenv.svg?style=flat-square "GNU Lesser General Public License v2.1")](https://github.com/pleiszenburg/wenv/blob/master/LICENSE)
[![status](https://img.shields.io/pypi/status/wenv.svg?style=flat-square "Project Development Status")](https://github.com/pleiszenburg/wenv/issues)
[![pypi_version](https://img.shields.io/pypi/v/wenv.svg?style=flat-square "Project Development Status")](https://pypi.python.org/pypi/wenv)
[![pypi_versions](https://img.shields.io/pypi/pyversions/wenv.svg?style=flat-square "Available on PyPi - the Python Package Index")](https://pypi.python.org/pypi/wenv)

![wenv](http://www.pleiszenburg.de/wenv_logo.png)
[![chat](https://img.shields.io/matrix/zugbruecke:matrix.org.svg?style=flat-square "Matrix Chat Room")](https://matrix.to/#/#zugbruecke:matrix.org)
[![mailing_list](https://img.shields.io/badge/mailing%20list-groups.io-8cbcd1.svg?style=flat-square "Mailing List")](https://groups.io/g/zugbruecke-dev)

## Synopsis

Expand All @@ -21,10 +23,8 @@ About Wine (from [winehq.org](https://www.winehq.org/)): *Wine (originally an ac

| prerequisite | version |
| --- | --- |
| [CPython](https://www.python.org/) | 3.x (tested with 3.{4,5,6,7,8}) |
| [Wine](https://www.winehq.org/) | 4.x (tested with regular & [staging](https://wine-staging.com/)) - expected to be in the user's [`PATH`](https://en.wikipedia.org/wiki/PATH_(variable)) |

If you are limited to an older version of Wine such as 2.x or 3.x, see `wenv`'s [installation instructions](https://wenv.readthedocs.io/en/latest/installation.html) for details and workarounds.
| [CPython](https://www.python.org/) | 3.x (tested with 3.{6,7,8,9,10}) |
| [Wine](https://www.winehq.org/) | >= 6.x (tested with regular & [staging](https://wine-staging.com/)) - expected to be in the user's [`PATH`](https://en.wikipedia.org/wiki/PATH_(variable)) |

## Installation

Expand Down
24 changes: 24 additions & 0 deletions docs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
WENV
Running Python on Wine
https://github.com/pleiszenburg/wenv
docs/__init__.py: Docs root
Copyright (C) 2017-2022 Sebastian M. Ernst <[email protected]>
<LICENSE_BLOCK>
The contents of this file are subject to the GNU Lesser General Public License
Version 2.1 ("LGPL" or "License"). You may not use this file except in
compliance with the License. You may obtain a copy of the License at
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
https://github.com/pleiszenburg/wenv/blob/master/LICENSE
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
specific language governing rights and limitations under the License.
</LICENSE_BLOCK>
"""
31 changes: 31 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% extends "!layout.html" %}

{% block menu %}

{{ super() }}

{% if sidebar_external_links %}

<p class="caption">
<span class="caption-text">
{% if sidebar_external_links_caption %}
{{ sidebar_external_links_caption }}
{% else %}
External links
{% endif %}
</span>
</p>

<ul>
{% for text, link in sidebar_external_links %}
{% if hasdoc(link) %}
<li class="toctree-l1"><a href="{{ pathto(link) }}">{{ text }}</a></li>
{% else %}
<li class="toctree-l1"><a href="{{ link }}">{{ text }}</a></li>
{% endif %}
{% endfor %}
</ul>

{% endif %}

{% endblock %}
89 changes: 13 additions & 76 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,83 +3,20 @@
.. _wineenv:

.. index::
single: env python
single: env pip
single: env pytest
single: env init
triple: wine; python; environment
module: wenv._core.env
single: API
single: classes
single: functions
single: methods

API: class ``Env``
==================
API
===

``wenv`` can not only be used from the command line. It also offers an API through its ``Env`` class.
``wenv`` can not only be used from the command line. It also offers an API and is therefore fully programmable.

Constructor: ``Env(**kwargs)``
------------------------------
.. toctree::
:maxdepth: 2
:caption: The API in detail

The constructor expects an arbitrary number of keyword arguments matching valid configuration options.

In previous releases, the constructor expected one optional argument, ``parameter``. It should either be ``None`` or a dictionary. In the latter case, the dictionary may contain all valid configuration options. ``parameter`` can still be used but is deprecated.

Method: ``ensure()``
--------------------

Equivalent of ``wenv init``. Intended to be used by 3rd-party packages which want to "ensure" that ``wenv`` has been initialized (i.e. *Python* and *pip* are present and working). ``ensure()`` calls ``wine_47766_workaround()`` internally.

Method: ``wine_47766_workaround()``
-----------------------------------

Due to *Wine*'s bug #47766, *Wine* crashes if **any** folder in the path to ``pythonprefix`` is hidden Unix-style (i.e. prefixed with a dot / ``.``). This workaround creates a symlink directly pointing to ``pythonprefix`` into ``/tmp``, which is (more or less) guaranteed to be visible. It is then used instead of the actual ``pythonprefix``.

Run ``setup_wineprefix`` and ``setup_pythonprefix`` **before** calling ``wine_47766_workaround``. Any subsequent action such as installing or using ``pip`` must happen **after** calling ``wine_47766_workaround``.

Method: ``setup_wineprefix(overwrite = False)``
-----------------------------------------------

Part of the initialization process, but can be triggered on its own if required. It creates a *Wine* prefix according to *wenv*'s configuration. If ``overwrite`` is set to ``True``, a pre-existing *Wine* prefix is removed before a new one is created.

Method: ``setup_pythonprefix(overwrite = False)``
-------------------------------------------------

Part of the initialization process, but can be triggered on its own if required. It installs the *CPython* interpreter into the *Python* prefix. If ``overwrite`` is set to ``True``, a pre-existing *Python* prefix is removed before a new one is created.

Method: ``setup_pip()``
-----------------------

Part of the initialization process, but can be triggered on its own if required. It installs ``pip``, assuming that both the ``wineprefix`` and ``pythonprefix`` are already present.

Method: ``install_package(name, update = False)``
-------------------------------------------------

Thin wrapper around ``wenv pip install [-U] {name}``.

Method: ``uninstall_package(name)``
-----------------------------------

Thin wrapper around ``wenv pip uninstall -y {name}``.

Method: ``list_packages()``
---------------------------

Thin wrapper around ``wenv pip list --format json``. Returns a list of dictionaries.

Method: ``shebang()``
---------------------

Shebang entry point.

Method: ``cli()``
-----------------

Command line interface entry point.

Method: ``uninstall()``
-----------------------

Equivalent of ``wenv clear``. Removes the current Wine Python environment.

Method: ``setup_coverage_activate()``
-------------------------------------

Equivalent of ``wenv init_coverage``. Activates coverage analysis throughout the Wine Python environment.
env
envconfig
pythonversion
1 change: 1 addition & 0 deletions docs/changes.md
Loading

0 comments on commit 03f6704

Please sign in to comment.