02-14-2019, 06:57 PM
Python 3.8 alpha in Fedora
<div style="margin: 5px 5% 10px 5%;"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2019/02/python-3-8-alpha-in-fedora.png" width="72" height="72" title="" alt="" /></div><div><p>The Python developers have released the first alpha of Python 3.8.0 and you can already try it out in Fedora! Test your Python code with 3.8 early to avoid surprises once the final 3.8.0 is out in October.</p>
<h2>Install Python 3.8 on Fedora</h2>
<p>If you have Fedora 29 or newer, you can install Python 3.8 from the official software repository with <em>dnf</em>:</p>
<pre class="wp-block-preformatted">$ sudo dnf install python38</pre>
<p>As more alphas, betas and release candidates of <a href="https://www.python.org/dev/peps/pep-0569/">Python 3.8 will be released</a>, the Fedora package will receive updates. No need to compile your own development version of Python, just install it and have it up to date. New features will be added until the first beta.</p>
<h2>Test your projects with Python 3.8</h2>
<p>Run the <em>python3.8</em> command to use Python 3.8 or create virtual environments with the <a href="https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html">builtin </a><em><a href="https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html">venv</a></em><a href="https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html"> module, <em>tox</em></a> or with <a href="https://fedoramagazine.org/install-pipenv-fedora/"><em>pipenv</em></a>. For example:</p>
<pre class="wp-block-preformatted">$ git clone https://github.com/benjaminp/six.git<br />Cloning into 'six'...<br />$ cd six/<br />$ <strong>tox -e py38</strong><br />py38 runtests: commands[0] | python -m pytest -rfsxX<br />================== test session starts ===================<br />platform linux -- <strong>Python 3.8.0a1</strong>, pytest-4.2.1, py-1.7.0, pluggy-0.8.1<br />collected 195 items <br /><br />test_six.py ...................................... [ 19%]<br />.................................................. [ 45%]<br />.................................................. [ 70%]<br />..............................................s... [ 96%]<br />....... [100%]<br />========= 194 passed, 1 skipped in 0.25 seconds ==========<br />________________________ summary _________________________<br /> py38: commands succeeded<br /> congratulations <img src="http://www.sickgaming.net/blog/wp-content/uploads/2019/02/python-3-8-alpha-in-fedora.png" alt="?" class="wp-smiley" style="height: 1em;max-height: 1em" /> </pre>
<h2>What’s new in Python 3.8</h2>
<p>So far, only the first alpha was released, so <a href="https://docs.python.org/3.8/whatsnew/3.8.html">more features will come</a>. You can however already try out the <a href="https://www.python.org/dev/peps/pep-0572/">new walrus operator</a>:</p>
<pre class="wp-block-preformatted">$ <strong>python3.8</strong><br />Python 3.8.0a1 (default, Feb 7 2019, 08:07:33) <br />[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux<br />Type "help", "copyright", "credits" or "license" for more information.<br />>>> while not (<strong>answer := input</strong>('Say something: ')):<br />... print("I don't like empty answers, try again...")<br />... <br />Say something: <br />I don't like empty answers, try again...<br />Say something: Fedora<br />>>></pre>
<p>And stay tuned for <a href="https://fedoraproject.org/wiki/Changes/Python3.8">Python 3.8 as <em>python3</em> in Fedora 31</a>!</p>
</div>
<div style="margin: 5px 5% 10px 5%;"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2019/02/python-3-8-alpha-in-fedora.png" width="72" height="72" title="" alt="" /></div><div><p>The Python developers have released the first alpha of Python 3.8.0 and you can already try it out in Fedora! Test your Python code with 3.8 early to avoid surprises once the final 3.8.0 is out in October.</p>
<h2>Install Python 3.8 on Fedora</h2>
<p>If you have Fedora 29 or newer, you can install Python 3.8 from the official software repository with <em>dnf</em>:</p>
<pre class="wp-block-preformatted">$ sudo dnf install python38</pre>
<p>As more alphas, betas and release candidates of <a href="https://www.python.org/dev/peps/pep-0569/">Python 3.8 will be released</a>, the Fedora package will receive updates. No need to compile your own development version of Python, just install it and have it up to date. New features will be added until the first beta.</p>
<h2>Test your projects with Python 3.8</h2>
<p>Run the <em>python3.8</em> command to use Python 3.8 or create virtual environments with the <a href="https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html">builtin </a><em><a href="https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html">venv</a></em><a href="https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html"> module, <em>tox</em></a> or with <a href="https://fedoramagazine.org/install-pipenv-fedora/"><em>pipenv</em></a>. For example:</p>
<pre class="wp-block-preformatted">$ git clone https://github.com/benjaminp/six.git<br />Cloning into 'six'...<br />$ cd six/<br />$ <strong>tox -e py38</strong><br />py38 runtests: commands[0] | python -m pytest -rfsxX<br />================== test session starts ===================<br />platform linux -- <strong>Python 3.8.0a1</strong>, pytest-4.2.1, py-1.7.0, pluggy-0.8.1<br />collected 195 items <br /><br />test_six.py ...................................... [ 19%]<br />.................................................. [ 45%]<br />.................................................. [ 70%]<br />..............................................s... [ 96%]<br />....... [100%]<br />========= 194 passed, 1 skipped in 0.25 seconds ==========<br />________________________ summary _________________________<br /> py38: commands succeeded<br /> congratulations <img src="http://www.sickgaming.net/blog/wp-content/uploads/2019/02/python-3-8-alpha-in-fedora.png" alt="?" class="wp-smiley" style="height: 1em;max-height: 1em" /> </pre>
<h2>What’s new in Python 3.8</h2>
<p>So far, only the first alpha was released, so <a href="https://docs.python.org/3.8/whatsnew/3.8.html">more features will come</a>. You can however already try out the <a href="https://www.python.org/dev/peps/pep-0572/">new walrus operator</a>:</p>
<pre class="wp-block-preformatted">$ <strong>python3.8</strong><br />Python 3.8.0a1 (default, Feb 7 2019, 08:07:33) <br />[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux<br />Type "help", "copyright", "credits" or "license" for more information.<br />>>> while not (<strong>answer := input</strong>('Say something: ')):<br />... print("I don't like empty answers, try again...")<br />... <br />Say something: <br />I don't like empty answers, try again...<br />Say something: Fedora<br />>>></pre>
<p>And stay tuned for <a href="https://fedoraproject.org/wiki/Changes/Python3.8">Python 3.8 as <em>python3</em> in Fedora 31</a>!</p>
</div>