From e01d21d0b580a065d463090464dbf80d2bd74c98 Mon Sep 17 00:00:00 2001 From: Loek Nijsten Date: Mon, 22 Jun 2020 21:07:19 +0200 Subject: [PATCH 1/2] Fix typos, update minimal requirements and Makefile --- cookiecutter.json | 2 +- {{cookiecutter.project_slug}}/INSTALL.md | 2 +- {{cookiecutter.project_slug}}/Makefile | 14 +++----------- {{cookiecutter.project_slug}}/README.md | 10 +++++----- {{cookiecutter.project_slug}}/docs/README.md | 2 +- 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 90ff685..2742665 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -12,6 +12,6 @@ "url": "https://gitlab.com/username/netsquid-mysnippet", "docs_server": "docs.netsquid.org", "pip_server": "pypi.netsquid.org", - "netsquid_constraint": ">=0.8.0,<0.9.0", + "netsquid_constraint": ">=0.9.1,<1.0.0", "minimum_coverage": 0 } diff --git a/{{cookiecutter.project_slug}}/INSTALL.md b/{{cookiecutter.project_slug}}/INSTALL.md index a83d4ac..855d7c3 100644 --- a/{{cookiecutter.project_slug}}/INSTALL.md +++ b/{{cookiecutter.project_slug}}/INSTALL.md @@ -1,7 +1,7 @@ NetSquid Snippet Installation ============================= -There are the general installation instructions for [NetSquid snippet](https://netsquid.org/snippets) packages. +These are the general installation instructions for [NetSquid snippet](https://netsquid.org/snippets) packages. Installation ------------ diff --git a/{{cookiecutter.project_slug}}/Makefile b/{{cookiecutter.project_slug}}/Makefile index 40a01a8..00ffa07 100644 --- a/{{cookiecutter.project_slug}}/Makefile +++ b/{{cookiecutter.project_slug}}/Makefile @@ -19,12 +19,12 @@ help: @echo "python-deps Installs the requirements needed for using the package." @echo "docs Creates the html documentation" @echo "clean Removes all .pyc files." - test-deps: @$(PYTHON3) -m pip install -r test_requirements.txt -requirements python-deps: _check_variables +requirements python-deps: + @$(PYTHON3) -m pip install "pip>=19.0" @$(PYTHON3) -m pip install -r requirements.txt ${PIP_FLAGS} clean: @@ -48,17 +48,9 @@ docs html: bdist: @$(PYTHON3) setup.py bdist_wheel -install: _check_variables test-deps +install: python-deps test-deps @$(PYTHON3) -m pip install -e . ${PIP_FLAGS} -_check_variables: -ifndef NETSQUIDPYPI_USER - $(error Set the environment variable NETSQUIDPYPI_USER before uploading) -endif -ifndef NETSQUIDPYPI_PWD - $(error Set the environment variable NETSQUIDPYPI_PWD before uploading) -endif - _clean_dist: @/bin/rm -rf dist diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md index a98d557..4558cc3 100644 --- a/{{cookiecutter.project_slug}}/README.md +++ b/{{cookiecutter.project_slug}}/README.md @@ -16,7 +16,7 @@ See the [INSTALL file](INSTALL.md) for instruction of how to install this snippe Documentation ------------- -So build and see the docs see the [docs README](docs/README.md). +To build and see the docs see the [docs README](docs/README.md). Usage ----- @@ -35,14 +35,14 @@ License The NetSquid-SnippetTemplate has the following license: -> Copyright 2018 QuTech (TUDelft and TNO) -> +> Copyright 2020 QuTech (TUDelft and TNO) +> > Licensed under the Apache License, Version 2.0 (the "License"); > you may not use this file except in compliance with the License. > You may obtain a copy of the License at -> +> > http://www.apache.org/licenses/LICENSE-2.0 -> +> > Unless required by applicable law or agreed to in writing, software > distributed under the License is distributed on an "AS IS" BASIS, > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/{{cookiecutter.project_slug}}/docs/README.md b/{{cookiecutter.project_slug}}/docs/README.md index cc69b89..b0baf61 100644 --- a/{{cookiecutter.project_slug}}/docs/README.md +++ b/{{cookiecutter.project_slug}}/docs/README.md @@ -14,7 +14,7 @@ To open the built docs, do: ```bash make open ``` -which makes use of the command `open`. If you're on Linux and `open` does not work you can add `alias open='xdg-open` to you rc-file. +which makes use of the command `open`. If you're on Linux and `open` does not work you can add `alias open='xdg-open'` to you rc-file. To both build the html files and open them, do: ```bash From 555070c05d12f0992cf903922fe183dd0f649b2e Mon Sep 17 00:00:00 2001 From: Loek Nijsten Date: Tue, 23 Jun 2020 13:46:33 +0200 Subject: [PATCH 2/2] Update install readme explaing user name and password for pypi server --- {{cookiecutter.project_slug}}/INSTALL.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.project_slug}}/INSTALL.md b/{{cookiecutter.project_slug}}/INSTALL.md index 855d7c3..3f1d520 100644 --- a/{{cookiecutter.project_slug}}/INSTALL.md +++ b/{{cookiecutter.project_slug}}/INSTALL.md @@ -10,17 +10,13 @@ For Python to be able to find the NetSquid snippet package it needs to be instal ### Install using pip -To install the package using pip run the following command in the repository root directory: +To install the package and its requirements using pip run the following command in the repository root directory: ```shell make install ``` -Note: If your snippet depends on other snippets on the netsquid server you first need to install them as - -```shell -pip3 install -r requirements.txt --extra-index-url https://:@pypi.netsquid.org -``` +Note: To be able to install NetSquid and possibly other snippets on the netsquid server you need to provide your user name and password for the pypi server (*pypi.netsquid.org*); these match your forum credentials. You can store the user name and password in the environment variables NETSQUIDPYPI_USER and NETSQUIDPYPI_PWD, respectively, to prevent having to type them in manually during installation. ### Install without using pip