<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: nikeasyanzi</title>
    <description>The latest articles on DEV Community by nikeasyanzi (@nikeasyanzi).</description>
    <link>https://dev.to/nikeasyanzi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F676222%2F6d46b232-7221-4802-83bf-e92b83a4e483.jpeg</url>
      <title>DEV Community: nikeasyanzi</title>
      <link>https://dev.to/nikeasyanzi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nikeasyanzi"/>
    <language>en</language>
    <item>
      <title>Python UV: The Fastest Python Package Manager</title>
      <dc:creator>nikeasyanzi</dc:creator>
      <pubDate>Sat, 28 Jun 2025 06:12:01 +0000</pubDate>
      <link>https://dev.to/nikeasyanzi/python-uv-the-fastest-python-package-manager-440i</link>
      <guid>https://dev.to/nikeasyanzi/python-uv-the-fastest-python-package-manager-440i</guid>
      <description>&lt;p&gt;It's been a headache to manage Python packages. But I feel I am saved from that when I meet &lt;a href="https://github.com/astral-sh/uv" rel="noopener noreferrer"&gt;UV&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;There are two main concerns related to the Python package management problem.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Python version: Different projects may need different Python interpreters. No one wants to mix them with the system default Python interpreters.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The packages/libraries needed by the project: Intuitively, different projects have different library dependencies. Even if they all rely on a popular library such as OpenSSL, they may depend on different library versions. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some tools are trying to solve the problem. &lt;br&gt;
For example, &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.python.org/3/library/venv.html" rel="noopener noreferrer"&gt;venv&lt;/a&gt; and &lt;a href="https://github.com/pypa/pip" rel="noopener noreferrer"&gt;pip&lt;/a&gt; provide package management but are unable to switch between different versions of Python.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/pyenv/pyenv" rel="noopener noreferrer"&gt;Pyenv&lt;/a&gt; solves the Python version switching problem but does not support package management.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/astral-sh/uv" rel="noopener noreferrer"&gt;UV&lt;/a&gt; is developed and aimed at solving the aforementioned issues.&lt;/p&gt;

&lt;p&gt;Here, I walk through how to use &lt;strong&gt;uv&lt;/strong&gt; to manage your project.&lt;/p&gt;
&lt;h2&gt;
  
  
  Walkthrough
&lt;/h2&gt;
&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;

&lt;p&gt;For macOS and Linux. I would use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -LsSf https://astral.sh/uv/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or through &lt;strong&gt;brew&lt;/strong&gt; for macOS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install uv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Important files
&lt;/h4&gt;

&lt;p&gt;The are some key files for UV to manage the project dependency.&lt;br&gt;
In addition, the good news is UV automatically generates and updates these files. Let's take a quick look.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;.python-version: contains the Python version used for the project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;pyproject.toml: serves as the main configuration file for project metadata and dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;uv.lock: Lock files for dependency management in UV. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Initialization
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ uv init my-uv
Initialized project `my-uv` at `/Users/craigyang/workplace/my-uv`

$ cd my-uv

$ tree -a -L 1
.
├── .git
├── .gitignore
├── .python-version
├── main.py
├── pyproject.toml
└── README.md

2 directories, 5 files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Running Python scripts with UV
&lt;/h4&gt;

&lt;p&gt;Let's take a look on the main.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cat main.py
def main():
    print("Hello from my-uv!")


if __name__ == "__main__":
    main()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While executing the main.py, a virtual environment is created automatically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ uv run main.py
Using CPython 3.13.4
Creating virtual environment at: .venv
Hello from my-uv!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Updating dependencies
&lt;/h4&gt;

&lt;p&gt;Here, we use requests as a new library to be added. We can see the content pyproject.toml is also updated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ uv add requests
Resolved 6 packages in 605ms
Prepared 2 packages in 223ms
Installed 5 packages in 10ms
 + certifi==2025.4.26
 + charset-normalizer==3.4.2
 + idna==3.10
 + requests==2.32.4
 + urllib3==2.4.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cat pyproject.toml
[project]
name = "my-uv"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = "&amp;gt;=3.13"
dependencies = [
    "requests&amp;gt;=2.32.4",
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Managing Python Versions in UV
&lt;/h4&gt;

&lt;p&gt;In the following prompt, we see that for the my-uv project, Python3.13 is the default option, while in the system, it is installed with Python3.9.6&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ uv python list
cpython-3.14.0b1-macos-aarch64-none                 &amp;lt;download available&amp;gt;
cpython-3.14.0b1+freethreaded-macos-aarch64-none    &amp;lt;download available&amp;gt;
cpython-3.13.4-macos-aarch64-none                   /opt/homebrew/bin/python3.13 -&amp;gt; ../Cellar/python@3.13/3.13.4/bin/python3.13
cpython-3.13.4-macos-aarch64-none                   /opt/homebrew/bin/python3 -&amp;gt; ../Cellar/python@3.13/3.13.4/bin/python3
cpython-3.13.4-macos-aarch64-none                   /Users/craigyang/.local/share/uv/python/cpython-3.13.4-macos-aarch64-none/bin/python3.13
cpython-3.13.4+freethreaded-macos-aarch64-none      &amp;lt;download available&amp;gt;
cpython-3.12.11-macos-aarch64-none                  &amp;lt;download available&amp;gt;
cpython-3.11.13-macos-aarch64-none                  &amp;lt;download available&amp;gt;
cpython-3.10.18-macos-aarch64-none                  &amp;lt;download available&amp;gt;
cpython-3.9.23-macos-aarch64-none                   &amp;lt;download available&amp;gt;
cpython-3.9.6-macos-aarch64-none                    /usr/bin/python3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Export requirements in UV
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; uv export -o requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We have shown how to use uv to start a new project.&lt;br&gt;
I also recommend &lt;a href="https://www.datacamp.com/tutorial/python-uv" rel="noopener noreferrer"&gt;a comprehensive article about uv&lt;/a&gt; for people interest in this topic.&lt;/p&gt;

</description>
      <category>python</category>
      <category>uv</category>
    </item>
    <item>
      <title>Hosting a HTTP server over UEFI</title>
      <dc:creator>nikeasyanzi</dc:creator>
      <pubDate>Tue, 22 Oct 2024 07:04:42 +0000</pubDate>
      <link>https://dev.to/nikeasyanzi/hosting-a-http-server-over-uefi-3hje</link>
      <guid>https://dev.to/nikeasyanzi/hosting-a-http-server-over-uefi-3hje</guid>
      <description>&lt;h1&gt;
  
  
  HTTP-UEFI
&lt;/h1&gt;

&lt;p&gt;This is a Python script to host an HTTP server under UEFI for remote testing purposes.&lt;/p&gt;

&lt;p&gt;It is built against Python 3.6.8 provided on EDK II.&lt;/p&gt;

&lt;p&gt;It supports operations such as file upload, test utility run, and log read to facilitate the testing process.&lt;/p&gt;

&lt;h1&gt;
  
  
  How to use
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Copy the built Python libraries which are folders Tools and StdLib and the &lt;strong&gt;http_uefi.py&lt;/strong&gt; in this repo  under your UEFI environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Python 3 enablement on UEFI, please refer to &lt;a href="https://github.com/tianocore/edk2-libc/releases/tag/v3.6.8.1" rel="noopener noreferrer"&gt;https://github.com/tianocore/edk2-libc/releases/tag/v3.6.8.1&lt;/a&gt; provided by &lt;a href="https://github.com/jpshivakavi" rel="noopener noreferrer"&gt;Jayaprakash Nevara&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to build by yourself, please refer to &lt;a href="https://github.com/tianocore/edk2-libc/blob/master/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt" rel="noopener noreferrer"&gt;https://github.com/tianocore/edk2-libc/blob/master/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7tv3kn7dmykgh3xk00yx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7tv3kn7dmykgh3xk00yx.png" alt="image" width="495" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the HTTP server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ecb5btx4krmvwxo1bz7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ecb5btx4krmvwxo1bz7.png" alt="image" width="793" height="164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Operation supported and Usage
&lt;/h1&gt;

&lt;p&gt;Assume we set TARGETURL=&lt;a href="http://192.168.100.108:8080" rel="noopener noreferrer"&gt;http://192.168.100.108:8080&lt;/a&gt;. The following commands demonstrate a simple test scenario from a test utility upload to the test result retrieval. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upload where it creates an &lt;code&gt;uploads&lt;/code&gt; folder automatically and place the uploaded files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;curl -X POST -H "Content-Type: multipart/form-data" -F "file=@my_wake_test.efi" ${TARGETURL}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;List list dir with the custom path &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;curl -H "Content-Type: application/json" -X POST --data '{"operation":"listdir","path":"FS0:\uploads"}' ${TARGETURLi}/listdir&lt;/p&gt;

&lt;p&gt;curl ${TARGETURL}/getfilelist&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run run the efi test utility&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;curl ${TARGETURL}/run/my_wake_test.efi&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ReadLog with the customized path
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapllrna2dofzsx7jlugx.png" alt="Image description" width="793" height="164"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is built against Python 3.6.8 provided on EDK II.&lt;/p&gt;

&lt;p&gt;It supports operations such as file upload, test utility run, and log read to facilitate the testing process.&lt;/p&gt;

&lt;p&gt;Check this out!&lt;br&gt;
&lt;a href="https://github.com/nikeasyanzi/http_uefi" rel="noopener noreferrer"&gt;https://github.com/nikeasyanzi/http_uefi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>uefi</category>
    </item>
  </channel>
</rss>
