Skip to main content
=======
pynuget
=======

.. image:: https://img.shields.io/travis/dougthor42/pynuget.svg
:alt: Travis
:target: https://travis-ci.org/dougthor42/pynuget


A port of Daniel15's `simple-nuget-server`_ because I
don't know PHP or Nginx. Runs on Flask and Apache. Python 3.5+

.. _simple-nuget-server: https://github.com/Daniel15/simple-nuget-server/


Installation
------------


1. Install the Prerequisites
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you're savvy, you could use nginx instead. I am not savvy.

.. code-block:: shell

$ sudo apt install apache2
$ sudo apt install libapache2-mod-wsgi-py3


2. Create a Virtual Environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is highly recommended. I also haven't bothered to figure out how to do
a non-venv install so... If you want to do that you're on your own! When
you figure it out, please submit a PR for this documentation. :smile:

.. code-block:: shell

$ python3 -m venv /usr/local/venv-pynuget/ # or anywhere
$ . /usr/local/venv-pynuget/bin/activate


3. Install the Package
^^^^^^^^^^^^^^^^^^^^^^

If I've done things correctly, all the requirements should be automatically
installed.

.. code-block:: shell

$ pip install pynuget


4. Run the Initial Setup Script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To (hopefully) make things easier, I've included a CLI command that
initializes the server with some reasonable defaults. This is pretty
undocumented at this time, but my hope is that it will eventually support
full customization of the server.

.. code-block:: shell

$ sudo -E /usr/local/venv-pynuget/bin/pynuget init

.. important::

Note the ``-E`` flag on ``sudo``! This preserves environment variables.
We're specifically interested in the ``VIRTUAL_ENV`` variable, as that's
needed to update the WSGI file.

.. note::

TODO: Instructions for a system install.

+ Sorry that this needs sudo! I haven't come up with a better way
around this. Suggestions or PRs welcome!
+ This will do various things including but not limited to:
+ Creating ``/var/www/pynuget``, populating it with the WSGI file and
repository folders and adjusting permissions
+ Copying over the example apache config and enabling the site
+ Restarting apache


5. Test Things
^^^^^^^^^^^^^^

1. ``curl localhost`` should return a short blurb about nuget
2. On Windows::

nuget.exe push Foo.nupkg -ApiKey YourApiKey -Source http://your.server.com

3. On Linux with Mono::

mono /path/to/nuget.exe push Foo.nupkg -ApiKey YourApiKey -Source http://your.server.address

4. If your server has a Window manager, you can open up a web browser and
navigate to ``http://localhost`` and you should see the PyNuGet landing
page.


6. Change your Secrets!
^^^^^^^^^^^^^^^^^^^^^^^

Make sure to change your secret keys to random values. One way to do so is
outlined in the `flask tutorial`_. You'll need to change 2 values in
``/var/www/pynuget/config.py``::

SECRET_KEY
API_KEYS


Release files for PyNuGet 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyNuGet 0.2.5
File Size Uploaded
pynuget-0.2.5.tar.gz 24.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyNuGet 0.2.5
File Interpreter ABI Platform
pynuget-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 54.5 kB

Release files / pynuget-0.2.5.tar.gz

Download URL pynuget-0.2.5.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d7f64830fe5b678e870a24251e0e599201604d2c06f27af72ee34a0e99a6c53c
BLAKE2b-256 checksum
How to use checksums
1d307f184a15798f36111a7ae149d758b6e6b948001a2589383b76a9c5c1f89e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

Release files / pynuget-0.2.5-py3-none-any.whl

Download URL pynuget-0.2.5-py3-none-any.whl
Size 29.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d0916f90f9ee848575efaea973e0b19675b9d0485b4c636fa647972be3fcb85
BLAKE2b-256 checksum
How to use checksums
093fb4fd189716bcbb16a65ab3c2fc91d54fec6e942b4c97aadc48acbe3a0da2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page