Skip to content

Commit

Permalink
Merge pull request #5 from fair-workflows/make-keys
Browse files Browse the repository at this point in the history
Add make_nanopub_keys command to setup RSA keys for nanopub
  • Loading branch information
svenvanderburg authored Oct 13, 2020
2 parents ff822b3 + 750f91b commit 9827e02
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nanopub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
pip install -r requirements-dev.txt
- name: Create RSA key for nanopubs
run: |
./np mkkeys -a RSA
nanopub/np mkkeys -a RSA
- name: Lint with flake8
run: |
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include README.md
include np
include nanopub/_version.py
include requirements.txt
include requirements-dev.txt
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@

# nanopub
The nanopub python library provides a client for searching, publishing and modifying nanopublications.

# Setup
Install using pip:
```
pip install nanopub
```

To publish to the nanopub server you need to setup RSA keys. This allows the nanopub server to identify you.
```
make_nanopub_keys
```
14 changes: 14 additions & 0 deletions bin/make_nanopub_keys
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python

import subprocess

from nanopub.definitions import PKG_FILEPATH


def main():
np = str(PKG_FILEPATH / 'np')
subprocess.run([np, 'mkkeys', '-a', 'RSA'])


if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion nanopub/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.1"
__version__ = "0.1.2"
1 change: 1 addition & 0 deletions nanopub/definitions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path

ROOT_FILEPATH = Path(__file__).parent.parent
PKG_FILEPATH = Path(__file__).parent
TESTS_FILEPATH = ROOT_FILEPATH / 'tests'
TEST_RESOURCES_FILEPATH = TESTS_FILEPATH / 'resources'
4 changes: 2 additions & 2 deletions nanopub/java_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import rdflib

from nanopub.definitions import ROOT_FILEPATH
from nanopub.definitions import PKG_FILEPATH

# Location of nanopub tool (currently shipped along with the lib)
NANOPUB_SCRIPT = str(ROOT_FILEPATH / 'np')
NANOPUB_SCRIPT = str(PKG_FILEPATH / 'np')


def _shell_command(command):
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def get_version(rel_path):
],
},
include_package_data=True,
scripts=['bin/make_nanopub_keys'],
extras_require={
'dev': open('requirements-dev.txt', 'r').readlines()
},
Expand Down

0 comments on commit 9827e02

Please sign in to comment.