Skip to content

Instantly share code, notes, and snippets.

@mrtc0
Last active May 11, 2017 05:24
Show Gist options
  • Select an option

  • Save mrtc0/eddd5f2141d6efd6aafed3ff609adf0d to your computer and use it in GitHub Desktop.

Select an option

Save mrtc0/eddd5f2141d6efd6aafed3ff609adf0d to your computer and use it in GitHub Desktop.

Revisions

  1. mrtc0 revised this gist May 11, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion PyPI登録メモ.md
    Original 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
    ```
  2. mrtc0 revised this gist May 11, 2017. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions PyPI登録メモ.md
    Original 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に登録したパッケージをインストールする。
    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.` とエラーが返るはず。
    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を使う方法。
  3. mrtc0 created this gist May 11, 2017.
    43 changes: 43 additions & 0 deletions PyPI登録メモ.md
    Original 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。