<?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: Qichao</title>
    <description>The latest articles on DEV Community by Qichao (@chaosprint).</description>
    <link>https://dev.to/chaosprint</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%2F436991%2F4d552d1f-6c03-4c9a-9323-5632549c7e61.jpeg</url>
      <title>DEV Community: Qichao</title>
      <link>https://dev.to/chaosprint</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chaosprint"/>
    <language>en</language>
    <item>
      <title>The easiest way to upload your own pip package to pypi.org</title>
      <dc:creator>Qichao</dc:creator>
      <pubDate>Sun, 27 Mar 2022 10:20:52 +0000</pubDate>
      <link>https://dev.to/chaosprint/the-easiest-way-to-upload-your-own-pip-package-to-pypiorg-1dnk</link>
      <guid>https://dev.to/chaosprint/the-easiest-way-to-upload-your-own-pip-package-to-pypiorg-1dnk</guid>
      <description>&lt;p&gt;Python's package choice is a selling point of it. Yet the package management &lt;code&gt;pip&lt;/code&gt; can be quite tricky for starters with issues like &lt;code&gt;env&lt;/code&gt;, version number, etc.&lt;/p&gt;

&lt;p&gt;To publish a package using &lt;code&gt;pip&lt;/code&gt; to &lt;code&gt;pypi.org&lt;/code&gt; is not easier at all, due to the complicated and unintuitive process.&lt;/p&gt;

&lt;p&gt;The good news is, we have now have a wonderful &lt;code&gt;template&lt;/code&gt; to work with and the powerful &lt;code&gt;GitHub Action&lt;/code&gt; to help.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a template
&lt;/h2&gt;

&lt;p&gt;First, you should download this repo:&lt;br&gt;
&lt;a href="https://github.com/chaosprint/setup.py"&gt;https://github.com/chaosprint/setup.py&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some things to do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;change the name of &lt;code&gt;mypackage&lt;/code&gt; to &lt;code&gt;YOUR-PACKAGE-NAME&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Edit the &lt;code&gt;core.py&lt;/code&gt; to fit your need&lt;/li&gt;
&lt;li&gt;Edit the &lt;code&gt;setup.py&lt;/code&gt; based on the comment inside&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Use GitHub
&lt;/h2&gt;

&lt;p&gt;Now create a new GitHub repo.&lt;br&gt;
Upload your package and double check the license, readme, version number, author, etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a new action
&lt;/h3&gt;

&lt;p&gt;After you upload your code, click &lt;code&gt;Action&lt;/code&gt; on your repository.&lt;/p&gt;

&lt;p&gt;Choose &lt;code&gt;Publish Python Package&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Change the &lt;code&gt;__token__&lt;/code&gt; to your username on pypi.org (you should have registered one).&lt;/p&gt;

&lt;p&gt;Then, commit it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a secret in your repo settings
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Settings -&amp;gt; Secrets -&amp;gt; New repository secret&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;key: PYPI_API_TOKEN&lt;br&gt;
value: YOUR_PASSWORD_FOR_PYPI&lt;/p&gt;

&lt;h3&gt;
  
  
  Finally
&lt;/h3&gt;

&lt;p&gt;Create a release. Then the project will be built and uploaded to pypi automatically.&lt;/p&gt;

</description>
      <category>python</category>
      <category>package</category>
      <category>pip</category>
      <category>github</category>
    </item>
    <item>
      <title>Vite.js, Sevelte.js, and Windi CSS: The Perfect Combo for My Web Dev</title>
      <dc:creator>Qichao</dc:creator>
      <pubDate>Sun, 30 Jan 2022 08:44:40 +0000</pubDate>
      <link>https://dev.to/chaosprint/use-vitejs-seveltejs-and-windi-css-cf2</link>
      <guid>https://dev.to/chaosprint/use-vitejs-seveltejs-and-windi-css-cf2</guid>
      <description>&lt;h2&gt;
  
  
  Why
&lt;/h2&gt;

&lt;p&gt;Vite is fast.&lt;/p&gt;

&lt;p&gt;Svelte is elegant.&lt;/p&gt;

&lt;p&gt;Windi CSS is easier to install than Tailwind on Vite-Svelte.&lt;br&gt;
And you should read this before you choose: &lt;a href="https://github.com/windicss/windicss/discussions/176"&gt;https://github.com/windicss/windicss/discussions/176&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Preparation
&lt;/h2&gt;

&lt;p&gt;I strongly recommend pnpm as it is much faster and saves spaces on disks. If you haven't installed it, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -g pnpm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;p&gt;First, create new &lt;code&gt;vite&lt;/code&gt; project using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm create vite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then choose &lt;code&gt;svelte&lt;/code&gt; in the interactive CLI dialog.&lt;/p&gt;

&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd projectFolder
pnpm i
pnpm i -D vite-plugin-windicss windicss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in &lt;code&gt;vite.config.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import WindiCSS from 'vite-plugin-windicss'

// https://vitejs.dev/config/
export default {
  plugins: [
    WindiCSS(),
    svelte()
  ],
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;main.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'virtual:windi.css'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm dev
pnpm build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>vite</category>
      <category>svelte</category>
      <category>windicss</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
