From 1d7086adaed8cb30a19fd02ff16002b2e2a70028 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 May 2022 23:53:43 +0000 Subject: [PATCH 01/10] Bump grunt from 1.4.1 to 1.5.3 in /atramhasis/static/admin Bumps [grunt](https://github.com/gruntjs/grunt) from 1.4.1 to 1.5.3. - [Release notes](https://github.com/gruntjs/grunt/releases) - [Changelog](https://github.com/gruntjs/grunt/blob/main/CHANGELOG) - [Commits](https://github.com/gruntjs/grunt/compare/v1.4.1...v1.5.3) --- updated-dependencies: - dependency-name: grunt dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- atramhasis/static/admin/package-lock.json | 65 +++++++++++++---------- atramhasis/static/admin/package.json | 2 +- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/atramhasis/static/admin/package-lock.json b/atramhasis/static/admin/package-lock.json index 15dfc979..7050c692 100644 --- a/atramhasis/static/admin/package-lock.json +++ b/atramhasis/static/admin/package-lock.json @@ -1,6 +1,6 @@ { "name": "atramhasis", - "version": "0.7.0", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -45,7 +45,7 @@ "array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==", "dev": true }, "array-slice": { @@ -341,9 +341,9 @@ } }, "grunt": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.4.1.tgz", - "integrity": "sha512-ZXIYXTsAVrA7sM+jZxjQdrBOAg7DyMUplOMhTaspMRExei+fD0BTwdWXnn0W5SXqhb/Q/nlkzXclSi3IH55PIA==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.3.tgz", + "integrity": "sha512-mKwmo4X2d8/4c/BmcOETHek675uOqw0RuA/zy12jaspWqvTp4+ZeQF1W+OTpcbncnaBsfbQJ6l0l4j+Sn/GmaQ==", "dev": true, "requires": { "dateformat": "~3.0.3", @@ -351,7 +351,7 @@ "exit": "~0.1.2", "findup-sync": "~0.3.0", "glob": "~7.1.6", - "grunt-cli": "~1.4.2", + "grunt-cli": "~1.4.3", "grunt-known-options": "~2.0.0", "grunt-legacy-log": "~3.0.0", "grunt-legacy-util": "~2.0.1", @@ -498,9 +498,9 @@ }, "dependencies": { "async": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.2.tgz", - "integrity": "sha512-H0E+qZaDEfx/FY4t7iLRv1W2fFI6+pyCeTw1uN20AQPiwqwM6ojPxHxdLv4z8hi2DtnW9BOckSspLucW7pIE5g==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, "which": { @@ -601,9 +601,9 @@ } }, "is-core-module": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", - "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "dev": true, "requires": { "has": "^1.0.3" @@ -743,13 +743,13 @@ "dev": true }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" } }, "minimatch": { @@ -883,9 +883,9 @@ "dev": true }, "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "rechoir": { @@ -898,13 +898,14 @@ } }, "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "dev": true, "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "resolve-dir": { @@ -956,6 +957,12 @@ "has-flag": "^4.0.0" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -972,12 +979,12 @@ "dev": true }, "underscore.string": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", - "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.6.tgz", + "integrity": "sha512-VoC83HWXmCrF6rgkyxS9GHv8W9Q5nhMKho+OadDJGzL2oDYbYEppBaCMH6pFlwLeqj2QS+hhkw2kpXkSdD1JxQ==", "dev": true, "requires": { - "sprintf-js": "^1.0.3", + "sprintf-js": "^1.1.1", "util-deprecate": "^1.0.2" } }, diff --git a/atramhasis/static/admin/package.json b/atramhasis/static/admin/package.json index 0aadf5d0..1264d68e 100644 --- a/atramhasis/static/admin/package.json +++ b/atramhasis/static/admin/package.json @@ -16,7 +16,7 @@ "foundation-sites": "~5.5.0" }, "devDependencies": { - "grunt": "^1.4.1", + "grunt": "^1.5.3", "grunt-contrib-clean": "^1.1.0", "grunt-contrib-copy": "^0.8.2", "grunt-dojo": "^1.1.2", From d71adc749a0dcf678f781fb94fa0bd811a285364 Mon Sep 17 00:00:00 2001 From: Koen Van Daele Date: Tue, 14 Jun 2022 22:28:59 +0200 Subject: [PATCH 02/10] Update instructions on running the demo. Refs #699 --- docs/source/demo.rst | 68 ++++++++++++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 18 deletions(-) diff --git a/docs/source/demo.rst b/docs/source/demo.rst index 0f425958..57bd0451 100644 --- a/docs/source/demo.rst +++ b/docs/source/demo.rst @@ -7,41 +7,63 @@ Demo Running a demo site =================== -Atramhasis comes with a demo site include. This allows you to quickly evaluate -and inspect the software. To get started, just download Atramhasis from pypi and -install it. We recommend doing this in a virtualenvironment. +Checking a working instance of the Atramhasis can be done at `the Flanders +Heritage Thesaurus `_ or by running a +demo yourself. This allows you to quickly evaluate and inspect the software. +This can be done through the `cookiecutter` package. .. code-block:: bash $ mkvirtualenv atramhasis_demo - $ pip install -U atramhasis + $ pip install -U cookiecutter + +Once cookiecutter is installed, you use it to generate the demo site. + +.. code-block:: bash + $ cookiecutter gh:OnroerendErfgoed/atramhasis_scaffold_cookiecutter -Once Atramhasis is installed, you can call upon a pyramid scaffold to generate -the demo site. +Running this command will ask a few questions. Just accept the default answers, +unless you want to give your project a different name. After the +cookiecutter command, there should be a directory with the name of your +project (default: atramhasis_demo). Enter this directory and install +requirements: .. code-block:: bash - $ pcreate -s atramhasis_demo atramhasis_demo $ cd atramhasis_demo + $ pip install -r requirements-dev.txt + $ pip install -e . -This creates a local demo package you can run with just a few more commands: +Now it's time to setup our database (a simple SQLite database) and add some +testdata: .. code-block:: bash - # setup - $ pip install -r requirements-dev.txt - $ python setup.py develop - # download and install client side libraries - $ cd atramhasis_demo/static - $ npm install - $ cd ../.. - # create or upgrade database $ alembic upgrade head - # intialize sample data + # fill the database with data $ initialize_atramhasis_db development.ini - # generate full RDF dumps (not necessary for basic functionality) + +Optionally, we can create RDF dumps, but this is not necessary for basic +functionality: + +.. code-block:: bash + $ dump_rdf development.ini + +Almost done! All we need now are some frontend dependencies: + +.. code-block:: bash + + $ cd atramhasis_demo/static + $ npm install + +Finally, we can start our server. Return to the root of your project repo and +run pserve: + +.. code-block:: bash + + $ cd ../.. # start server $ pserve development.ini @@ -61,6 +83,11 @@ customisation for further information on this topic. Running a demo site with Docker =============================== +.. warning:: + + This older documentation, written for a previous version, and probably + doesn't work anymore. + There is a `Docker image `_ available that allows you to quickly get a demo instance up and running. The Docker image contains the demo application and the LDF server. @@ -97,6 +124,11 @@ to suit your needs. Running a demo site on Heroku ============================= +.. warning:: + + This older documentation, written for a previous version, and probably + doesn't work anymore. + This section will tell you how to deploy an Atramhasis demo (or your own implementation) in the cloud. We'll use `Heroku `_, since this provider allows for a free Python instance (dyno) with a limited Postgresql database. From e8e830b6f1a0787be2232c64dcb80b670f7c8fc0 Mon Sep 17 00:00:00 2001 From: Koen Van Daele Date: Thu, 23 Jun 2022 11:24:01 +0200 Subject: [PATCH 03/10] Fix cookiecutter reference. Refs #699 --- docs/source/demo.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/demo.rst b/docs/source/demo.rst index 57bd0451..700020d5 100644 --- a/docs/source/demo.rst +++ b/docs/source/demo.rst @@ -21,7 +21,7 @@ Once cookiecutter is installed, you use it to generate the demo site. .. code-block:: bash - $ cookiecutter gh:OnroerendErfgoed/atramhasis_scaffold_cookiecutter + $ cookiecutter gh:OnroerendErfgoed/atramhasis_demo_cookiecutter Running this command will ask a few questions. Just accept the default answers, unless you want to give your project a different name. After the From 25844cf3f2dee0983b741c599872967bccac613f Mon Sep 17 00:00:00 2001 From: roefem <62388265+roefem@users.noreply.github.com> Date: Thu, 23 Jun 2022 14:55:42 +0200 Subject: [PATCH 04/10] #702 update ldf config (#703) * #687 update ldf config * #687 fix importlib-metadata error * #687 reverted development.ini rdf2hdt path --- .travis.yml | 2 +- atramhasis/scripts/generate_ldf_config.py | 151 +++++++++++----------- docs/source/development.rst | 2 +- 3 files changed, 78 insertions(+), 77 deletions(-) diff --git a/.travis.yml b/.travis.yml index d50d046a..ed64f363 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: - "3.8" before_install: - pip install --upgrade pip - - pip install -U setuptools + - pip install setuptools==59.6.0 #https://github.com/pypa/setuptools/issues/3293 install: - pip install -r requirements-dev.txt - python setup.py develop diff --git a/atramhasis/scripts/generate_ldf_config.py b/atramhasis/scripts/generate_ldf_config.py index e9f01c7b..4d6c79ea 100644 --- a/atramhasis/scripts/generate_ldf_config.py +++ b/atramhasis/scripts/generate_ldf_config.py @@ -10,10 +10,7 @@ import json -from atramhasis.errors import ( - SkosRegistryNotFoundException -) - +from atramhasis.errors import SkosRegistryNotFoundException def main(): @@ -21,20 +18,22 @@ def main(): Generate a config file for a LDF server. """ usage = "usage: %prog config_uri" - parser = optparse.OptionParser( - usage=usage, - description=textwrap.dedent(description) - ) + parser = optparse.OptionParser(usage=usage, description=textwrap.dedent(description)) parser.add_option( - '-l', '--location', dest='config_location', type='string', - help='Specify where to put the config file. If not specified, this \ -is set to the atramhasis.ldf.config_location from your ini file.' + "-l", + "--location", + dest="config_location", + type="string", + help=( + "Specify where to put the config file. If not specified, this is set to the" + " atramhasis.ldf.config_location from your ini file." + ), ) options, args = parser.parse_args(sys.argv[1:]) if not len(args) >= 1: - print('You must provide at least one argument.') + print("You must provide at least one argument.") return 2 config_uri = args[0] @@ -44,102 +43,104 @@ def main(): config_location = options.config_location if config_location is None: - config_location = env['registry'].settings.get( - 'atramhasis.ldf.config_location', - os.path.abspath(os.path.dirname(config_uri)) + config_location = env["registry"].settings.get( + "atramhasis.ldf.config_location", os.path.abspath(os.path.dirname(config_uri)) ) - dump_location = env['registry'].settings.get( - 'atramhasis.dump_location', - os.path.abspath(os.path.dirname(config_uri)) + dump_location = env["registry"].settings.get( + "atramhasis.dump_location", os.path.abspath(os.path.dirname(config_uri)) ) - ldf_baseurl = env['registry'].settings.get( - 'atramhasis.ldf.baseurl', - None - ) + ldf_baseurl = env["registry"].settings.get("atramhasis.ldf.baseurl", None) - ldf_protocol = env['registry'].settings.get( - 'atramhasis.ldf.protocol', - None - ) + ldf_protocol = env["registry"].settings.get("atramhasis.ldf.protocol", None) - request = env['request'] + request = env["request"] - if hasattr(request, 'skos_registry') and request.skos_registry is not None: + if hasattr(request, "skos_registry") and request.skos_registry is not None: skos_registry = request.skos_registry else: - raise SkosRegistryNotFoundException() # pragma: no cover + raise SkosRegistryNotFoundException() # pragma: no cover start_time = time.time() ldfconfig = { - 'title': 'Atramhasis LDF server', - 'datasources': {}, - 'prefixes': { - 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', - 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', - 'owl': 'http://www.w3.org/2002/07/owl#', - 'xsd': 'http://www.w3.org/2001/XMLSchema#', - 'hydra': 'http://www.w3.org/ns/hydra/core#', - 'void': 'http://rdfs.org/ns/void#', - 'skos': 'http://www.w3.org/2004/02/skos/core#', - 'skos-thes': 'http://purl.org/iso25964/skos-thes#' - } + "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@ldf/server/^3.0.0/components/context.jsonld", + "@id": "urn:ldf-server:my", + "import": "preset-qpf:config-defaults.json", + "title": "Atramhasis LDF server", + "datasources": [], + "prefixes": [ + {"prefix": "rdf", "uri": "http://www.w3.org/1999/02/22-rdf-syntax-ns#"}, + {"prefix": "rdfs", "uri": "http://www.w3.org/2000/01/rdf-schema#"}, + {"prefix": "owl", "uri": "http://www.w3.org/2002/07/owl#"}, + {"prefix": "xsd", "uri": "http://www.w3.org/2001/XMLSchema#"}, + {"prefix": "hydra", "uri": "http://www.w3.org/ns/hydra/core#"}, + {"prefix": "void", "uri": "http://rdfs.org/ns/void#"}, + {"prefix": "skos", "uri": "http://www.w3.org/2004/02/skos/core#"}, + {"prefix": "skos-thes", "uri": "http://purl.org/iso25964/skos-thes#"}, + ], } if ldf_baseurl: - ldfconfig['baseURL'] = ldf_baseurl + ldfconfig["baseURL"] = ldf_baseurl if ldf_protocol: - ldfconfig['protocol'] = ldf_protocol + ldfconfig["protocol"] = ldf_protocol pids = [] for p in skos_registry.get_providers(): if any([not_shown in p.get_metadata()['subject'] for not_shown in ['external']]): - continue; - pid = p.get_metadata()['id'] + continue + pid = p.get_metadata()["id"] + title = p.concept_scheme.label().label if p.concept_scheme.label() else pid pids.append(pid) - filename = os.path.join(dump_location, '%s-full' % pid) - filename_ttl = filename + '.ttl' - filename_hdt = filename + '.hdt' - if os.path.isfile(filename_hdt): - dumptype = 'HdtDatasource' - dumpfile = filename_hdt - else: - dumptype = 'TurtleDatasource' - dumpfile = filename_ttl + filename = os.path.join(dump_location, "%s-full" % pid) + dumptype = "HdtDatasource" + filetype = "hdtFile" + dumpfile = filename + ".hdt" + + if not os.path.isfile(dumpfile): + dumptype = "TurtleDatasource" + filetype = "file" + dumpfile = filename + ".ttl" + sourceconfig = { - 'title': p.concept_scheme.label().label if p.concept_scheme.label() else pid, - 'type': dumptype, - 'settings': { - 'file': dumpfile - } + "@id": f"urn:ldf-server:myDatasource{pid}", + "@type": dumptype, + "quads": False, # TODO + "datasourcePath": pid, + "datasourceTitle": title, + filetype: dumpfile, } + for n in p.concept_scheme.notes: - if n.type in ['definition', 'scopeNote']: - sourceconfig['description'] = n.note + if n.type in ["definition", "scopeNote"]: + sourceconfig["description"] = n.note break - ldfconfig['datasources'][pid] = sourceconfig + + ldfconfig["datasources"].append(sourceconfig) if len(pids): - sourceconfig = { - 'title': 'All conceptschemes', - 'type': 'CompositeDatasource', - 'description': 'All conceptschemes contained in this Atramhasis instance together.', - 'settings': { - 'references': pids - } + composite_sourceconfig = { + "@id": "urn:ldf-server:myDatasourcecomposite", + "@type": "CompositeDatasource", + "quads": False, # TODO + "datasourcePath": "composite", + "datasourceTitle": "All conceptschemes", + "description": ( + "All conceptschemes contained in this Atramhasis instance together." + ), + "compose": [f"urn:ldf-server:myDatasource{pid}" for pid in pids], } - ldfconfig['datasources']['composite'] = sourceconfig - + ldfconfig["datasources"].append(composite_sourceconfig) - config_filename = os.path.join(config_location, 'ldf_server_config.json') + config_filename = os.path.join(config_location, "ldf_server_config.json") - with open(config_filename, 'w') as fp: + with open(config_filename, "w") as fp: json.dump(ldfconfig, fp, indent=4) - print('Config written to %s.' % config_filename) + print("Config written to %s." % config_filename) print("--- %s seconds ---" % (time.time() - start_time)) - env['closer']() + env["closer"]() diff --git a/docs/source/development.rst b/docs/source/development.rst index b1775f34..3ddb2b9f 100644 --- a/docs/source/development.rst +++ b/docs/source/development.rst @@ -236,7 +236,7 @@ refer to the LDF server documentation for troubleshooting. .. code-block:: bash # Install ldf-server - $ [sudo] npm install -g ldf-server + $ [sudo] npm install -g @ldf/server # Run ldf-server $ ldf-server ldf_server_config.json From 9f2d1e2d6ba521df0051568eb363640008d7ceaa Mon Sep 17 00:00:00 2001 From: roefem <62388265+roefem@users.noreply.github.com> Date: Mon, 27 Jun 2022 14:16:25 +0200 Subject: [PATCH 05/10] #702 drop jinja2.ext.with_ (#705) Co-authored-by: Bram Goessens --- development.ini | 1 - tests/conf_test.ini | 1 - 2 files changed, 2 deletions(-) diff --git a/development.ini b/development.ini index ebdc6256..d2661eb7 100644 --- a/development.ini +++ b/development.ini @@ -18,7 +18,6 @@ jinja2.directories = atramhasis:templates jinja2.extensions = jinja2.ext.do - jinja2.ext.with_ jinja2.filters = label_sort = atramhasis.utils.label_sort available_languages = en nl fr diff --git a/tests/conf_test.ini b/tests/conf_test.ini index 51dae47f..9089aa68 100644 --- a/tests/conf_test.ini +++ b/tests/conf_test.ini @@ -19,7 +19,6 @@ jinja2.directories = atramhasis:templates jinja2.extensions = jinja2.ext.do - jinja2.ext.with_ jinja2.filters = label_sort = atramhasis.utils.label_sort available_languages = en nl it From 987246e2319ee15241977e1c2c9cba5c8521e4a8 Mon Sep 17 00:00:00 2001 From: roefem <62388265+roefem@users.noreply.github.com> Date: Mon, 27 Jun 2022 14:16:39 +0200 Subject: [PATCH 06/10] #697 add pyramid_openapi3 to setup.py (#706) Co-authored-by: Bram Goessens --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index c0689f96..07595fea 100644 --- a/setup.py +++ b/setup.py @@ -53,6 +53,7 @@ def run(self): 'skosprovider_rdf', 'skosprovider_getty', 'pyramid_skosprovider', + 'pyramid_openapi3', 'language_tags', 'jinja2', 'pyramid_jinja2', From 2e74bd75de2e8805da9160e38be263989c2c7f25 Mon Sep 17 00:00:00 2001 From: roefem <62388265+roefem@users.noreply.github.com> Date: Mon, 27 Jun 2022 14:17:05 +0200 Subject: [PATCH 07/10] make session['last_visited'] json serializable (#704) Co-authored-by: Bram Goessens --- atramhasis/utils.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/atramhasis/utils.py b/atramhasis/utils.py index 15d0fac6..c52e66db 100644 --- a/atramhasis/utils.py +++ b/atramhasis/utils.py @@ -93,20 +93,17 @@ def advice(parent_object, *args, **kw): def update_last_visited_concepts(request, concept_data): - session = request.session - if 'last_visited' not in session: - session['last_visited'] = deque(maxlen=4) - last_visited = session['last_visited'] - + deque_last_visited = deque(maxlen=4) + deque_last_visited.extend(request.session.get('last_visited', [])) try: # Try to remove concept from the queue to prevent double entries - last_visited.remove(concept_data) + deque_last_visited.remove(concept_data) except ValueError: # Concept is not in the queue pass - # Add concept to the queue - last_visited.append(concept_data) + deque_last_visited.append(concept_data) + request.session['last_visited'] = list(deque_last_visited) def label_sort(concepts, language='any'): From b5e88e3e0232385131a47c873fbf4268fed10fbc Mon Sep 17 00:00:00 2001 From: Bram Goessens Date: Thu, 30 Jun 2022 14:52:24 +0200 Subject: [PATCH 08/10] Specify the title that this section contains instructions to run the demo with cookiecutter --- docs/source/demo.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/demo.rst b/docs/source/demo.rst index 700020d5..cfa9fcf2 100644 --- a/docs/source/demo.rst +++ b/docs/source/demo.rst @@ -4,8 +4,8 @@ Demo ==== -Running a demo site -=================== +Running a demo site with Cookiecutter +===================================== Checking a working instance of the Atramhasis can be done at `the Flanders Heritage Thesaurus `_ or by running a From c29bbc9825e181df7f57b4166786eeb105ef45ab Mon Sep 17 00:00:00 2001 From: Bram Goessens Date: Fri, 1 Jul 2022 15:27:04 +0200 Subject: [PATCH 09/10] prepare release 1.1.0 --- CITATION.cff | 2 +- atramhasis/openapi.yaml | 2 +- atramhasis/static/admin/package.json | 2 +- atramhasis/static/package.json | 2 +- docs/source/conf.py | 4 ++-- setup.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index ccd3e0f9..c9493bb9 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -81,5 +81,5 @@ keywords: - vocabulary - python license: GPL-3.0 -version: 1.0.3 +version: 1.1.0 date-released: '2021-12-22' diff --git a/atramhasis/openapi.yaml b/atramhasis/openapi.yaml index 31415d2d..624a09b6 100644 --- a/atramhasis/openapi.yaml +++ b/atramhasis/openapi.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Atramhasis API - version: 1.0.3 + version: 1.1.0 servers: - url: '/' diff --git a/atramhasis/static/admin/package.json b/atramhasis/static/admin/package.json index 1264d68e..2545cafa 100644 --- a/atramhasis/static/admin/package.json +++ b/atramhasis/static/admin/package.json @@ -1,6 +1,6 @@ { "name": "atramhasis", - "version": "1.0.0", + "version": "1.1.0", "description": "Node packages for building Atramhasis.", "repository": { "type": "git", diff --git a/atramhasis/static/package.json b/atramhasis/static/package.json index b99c3d82..2ca7b0b1 100644 --- a/atramhasis/static/package.json +++ b/atramhasis/static/package.json @@ -1,6 +1,6 @@ { "name": "atramhasis", - "version": "0.7.0", + "version": "1.1.0", "description": "Node packages for public part of Atramhasis.", "repository": { "type": "git", diff --git a/docs/source/conf.py b/docs/source/conf.py index 9e84ba8f..ff6f4345 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -57,9 +57,9 @@ # built documents. # # The short X.Y version. -version = '1.0' +version = '1.1' # The full version, including alpha/beta/rc tags. -release = '1.0.3' +release = '1.1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index 07595fea..8623ea26 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ def run(self): ] setup(name='atramhasis', - version='1.0.3', + version='1.1.0', description='A web based editor for thesauri adhering to the SKOS specification.', long_description=README + '\n\n' + CHANGES, long_description_content_type='text/x-rst', From e2e4e07801390a40bdcd4dcc070e285893eff6b0 Mon Sep 17 00:00:00 2001 From: Bram Goessens Date: Mon, 4 Jul 2022 09:13:48 +0200 Subject: [PATCH 10/10] The prepare command does no longer prepare files in the scaffold folder but is still needed to build the dojo code. --- docs/source/development.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/development.rst b/docs/source/development.rst index 3ddb2b9f..e2083547 100644 --- a/docs/source/development.rst +++ b/docs/source/development.rst @@ -290,7 +290,7 @@ Distribution ============ For building a distribution use the prepare command before the distribution command. -This will update the requirement files in the scaffolds. +This will build the dojo code in the static folder. .. code-block:: bash