https://github.com/gsuke/make-venv
Script to create .venv of Python
https://github.com/gsuke/make-venv
powershell shell-script venv-python
Last synced: about 1 month ago
JSON representation
Script to create .venv of Python
- Host: GitHub
- URL: https://github.com/gsuke/make-venv
- Owner: gsuke
- License: mit
- Created: 2021-09-19T10:48:22.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-01T15:17:51.000Z (over 4 years ago)
- Last Synced: 2025-12-09T15:22:46.259Z (6 months ago)
- Topics: powershell, shell-script, venv-python
- Language: PowerShell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= make_venv
venv(Python仮想環境)を構築するスクリプト。
近年、Pythonのパッケージ管理ライブラリには poetry や pyflow などがあるが、それらはまだ発展途上に感じる。
その背景を踏まえ、個人的に venv + requirements.txt をしばらく使いたかったので make_venv を作成した。
== 機能
* venv を再生成
* requirements.txt のパッケージをインストール
== 使い方(Linux)
. Python3 を導入する
. link:make_venv.sh?raw=true[make_venv.sh] をダウンロードし、Pythonプロジェクトディレクトリへ格納
+
[source, shell]
----
wget https://raw.githubusercontent.com/gsuke/make-venv/main/make_venv.sh
----
. (必要に応じてSettingsを変更)
. requirements.txt を作成し、必要なライブラリを入力
. `./make_venv.sh` を実行
== 使い方(Windows)
. 以下の実行環境を導入する
* https://www.python.org/[Python]
* PowerShell (7.2~)
.. https://www.microsoft.com/ja-jp/p/powershell/9mz1snwt0n5d よりインストールする
.. Powershellの初回起動時は以下のコマンドを叩き、実行ポリシーを変更する。
+
[source, powershell]
----
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
----
. link:make_venv.ps1?raw=true[make_venv.ps1] をダウンロードし、Pythonプロジェクトディレクトリへ格納
+
[source, powershell]
----
Invoke-WebRequest https://raw.githubusercontent.com/gsuke/make-venv/main/make_venv.ps1 -OutFile make_venv.ps1
----
. (必要に応じてSettingsを変更)
. requirements.txt を作成し、必要なライブラリを入力
. PowerShellで `.\make_venv.ps1` を実行
== 環境
以下の環境で動作確認済み。
* Windows 10
* Debian 11 (link:test/docker-compose.yml[docker-compose.yml] 参照)