Last active
May 11, 2017 05:24
-
-
Save mrtc0/eddd5f2141d6efd6aafed3ff609adf0d to your computer and use it in GitHub Desktop.
Revisions
-
mrtc0 revised this gist
May 11, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ password=your_password TestPyPIに登録する。 ``` python setup.py register -r https://testpypi.python.org/pypi python setup.py sdist upload -r https://testpypi.python.org/pypi ``` -
mrtc0 revised this gist
May 11, 2017 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,19 +18,21 @@ password=your_password ``` TestPyPIに登録する。 ``` python setup.py register -r https://testpypi.python.org/pypi python setup.py sdist upload -r https://testpypi.python.org/pypi ``` TestPyPIに登録したパッケージをインストールする。 ただし、dependentsなパッケージがtestpypiに登録されていないと失敗する。 ``` pip install --index-url https://testpypi.python.org/simple/ pypipkg ``` PyPI本家に登録する。 ここがハマりどころで、多くの記事では`python setup.py register` して `python setup.py sdist upload` するとあるが、これは古いやり方で、 `Server response (410): This API is no longer supported, instead simply upload the file.` とエラーが返るはず。 多分楽なのはtwineを使う方法。 -
mrtc0 created this gist
May 11, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ `~/.pypirc`に以下の内容を記述する。 ``` [distutils] index-servers = pypi pypitest [pypi] repository=https://pypi.python.org/pypi username=your_username password=your_password [pypitest] repository=https://testpypi.python.org/pypi username=your_username password=your_password ``` TestPyPIに登録する。 ``` python setup.py register -r https://testpypi.python.org/pypi python setup.py sdist upload -r https://testpypi.python.org/pypi ``` TestPyPIに登録したパッケージをインストールする。 ただし、dependentsなパッケージがtestpypiに登録されていないと失敗する。 ``` pip install --index-url https://testpypi.python.org/simple/ pypipkg ``` PyPI本家に登録する。 ここがハマりどころで、多くの記事では `python setup.py register` して `python setup.py sdist upload` するとあるが、これは古いやり方で、 `Server response (410): This API is no longer supported, instead simply upload the file.` とエラーが返るはず。 多分楽なのはtwineを使う方法。 ``` python setup.py sdist twine register dist/*.tar.gz twine upload dist/* ``` でOK。