Skip to content

Commit

Permalink
Merge branch 'master' into datecreatedbyapplication
Browse files Browse the repository at this point in the history
  • Loading branch information
ehanson8 authored Aug 6, 2024
2 parents ab87d61 + 4f73fa3 commit 9ab0dba
Show file tree
Hide file tree
Showing 28 changed files with 110 additions and 119 deletions.
16 changes: 0 additions & 16 deletions .flake8

This file was deleted.

28 changes: 6 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.1
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.12.0
hooks:
- id: reorder-python-imports
args: [--py38-plus]
- repo: https://github.com/psf/black
rev: "23.11.0"
hooks:
- id: black
args: [--safe, --quiet]
- repo: https://github.com/pycqa/flake8
rev: "6.1.0"
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==23.9.16
- flake8-comprehensions==3.14.0
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.37.0
rev: v0.41.0
hooks:
- id: markdownlint
exclude: |
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ corner, then select 'Your profile'. The API key will be displayed at the bottom
of the page.
To get the Storage Service API key, log in to the Storage Service as the user
you wish to authenticate as. From the dashboard, go to *Administration > Users*
you wish to authenticate as. From the dashboard, go to _Administration > Users_
and select 'Edit' for the user you want the key for. The API key will be
displayed at the bottom of the page. Storage Service versions earlier than
`0.8.x` do not require an API key, and will not provide one. In that case, fill
Expand Down Expand Up @@ -825,7 +825,7 @@ above about finding the Archivematica and Storage Service API keys. An example
configuration with placeholder parameters is provided in
[reingestconfig.json](transfers/reingestconfig.json)
*Reingest.py* is best used via the shell script provided in the
_Reingest.py_ is best used via the shell script provided in the
[_transfers/examples/reingest_](transfers/examples/reingest) folder. As it is
designed for bulk-reingest, it is best used in conjunction with a cronfile, an
example of which is provided in the same folder.
Expand Down Expand Up @@ -883,7 +883,7 @@ INFO 2018-10-26 00:00:03 reingest.py:194 Removing PID for current process.
```
1. Following completion of the first reingest, a second is started and we can
see similar log entries to those in *1.*
see similar log entries to those in _1._
```shell
$ ./run-reingest.sh
Expand Down Expand Up @@ -935,13 +935,13 @@ information could be found by looking up the status of the microservices:
Via the user interface:
- *http://{archivematica-url}}/transfer/{UUID}/*
- *http://{archivematica-url}}/ingest/{UUID}/*
- _http://{archivematica-url}}/transfer/{UUID}/_
- _http://{archivematica-url}}/ingest/{UUID}/_
Via the API (users will need to filter on package UUID):
- *http://{archivematica-url}}/transfer/status/*
- *http://{archivematica-url}}/ingest/status/*
- _http://{archivematica-url}}/transfer/status/_
- _http://{archivematica-url}}/ingest/status/_
## Related Projects
Expand Down
1 change: 1 addition & 0 deletions aips/create_dip.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
generated alongside the objects folder containing only a reference to the ZIP file
(without AMD or DMD sections).
"""

import argparse
import csv
import logging.config # Has to be imported separately
Expand Down
1 change: 1 addition & 0 deletions aips/create_dips_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Optionally, uploads those DIPs to AtoM or the Storage Service using
the scripts from `dips` and deletes the local copy.
"""

import argparse
import logging.config # Has to be imported separately
import os
Expand Down
2 changes: 1 addition & 1 deletion aips/models.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from os.path import isfile

from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import Integer
from sqlalchemy import Sequence
from sqlalchemy import String
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

Expand Down
2 changes: 1 addition & 1 deletion dips/atom_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
AtoM instance. A passwordless SSH connection is required to the AtoM host for the
user running this script and it must be already added to the list of known hosts.
"""

import argparse
import logging.config # Has to be imported separately
import os
Expand All @@ -15,7 +16,6 @@

import requests


THIS_DIR = os.path.abspath(os.path.dirname(__file__))
LOGGER = logging.getLogger("dip_workflow")

Expand Down
2 changes: 1 addition & 1 deletion dips/copy_to_netx.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Copies a local DIP to NetX, providing a CSV list of each object.
"""

import argparse
import csv
import logging.config # Has to be imported separately
Expand All @@ -14,7 +15,6 @@

import lxml.etree


THIS_DIR = os.path.abspath(os.path.dirname(__file__))
LOGGER = logging.getLogger("copy_to_netx")

Expand Down
2 changes: 1 addition & 1 deletion dips/storage_service_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Storage Service to process that DIP and create a relationship with the
AIP from where it was created.
"""

import argparse
import logging.config # Has to be imported separately
import os
Expand All @@ -17,7 +18,6 @@

import requests


THIS_DIR = os.path.abspath(os.path.dirname(__file__))
LOGGER = logging.getLogger("dip_workflow")

Expand Down
1 change: 1 addition & 0 deletions requirements-dev.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-r requirements.txt
pytest
pytest-cov
ruff
30 changes: 16 additions & 14 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,57 @@
#
amclient==1.3.0
# via -r requirements.txt
certifi==2023.11.17
certifi==2024.7.4
# via
# -r requirements.txt
# requests
charset-normalizer==3.3.2
# via
# -r requirements.txt
# requests
coverage[toml]==7.3.2
coverage[toml]==7.5.4
# via pytest-cov
exceptiongroup==1.2.0
exceptiongroup==1.2.1
# via pytest
greenlet==3.0.1
greenlet==3.0.3
# via
# -r requirements.txt
# sqlalchemy
idna==3.4
idna==3.7
# via
# -r requirements.txt
# requests
iniconfig==2.0.0
# via pytest
lxml==4.9.3
lxml==5.2.2
# via
# -r requirements.txt
# metsrw
metsrw==0.5.0
metsrw==0.5.1
# via -r requirements.txt
packaging==23.2
packaging==24.1
# via pytest
pluggy==1.3.0
pluggy==1.5.0
# via pytest
pytest==7.4.3
pytest==8.2.2
# via
# -r requirements-dev.in
# pytest-cov
pytest-cov==4.1.0
pytest-cov==5.0.0
# via -r requirements-dev.in
requests==2.31.0
requests==2.32.3
# via
# -r requirements.txt
# amclient
sqlalchemy==1.4.50
ruff==0.5.1
# via -r requirements-dev.in
sqlalchemy==1.4.52
# via -r requirements.txt
tomli==2.0.1
# via
# coverage
# pytest
urllib3==2.1.0
urllib3==2.2.2
# via
# -r requirements.txt
# amclient
Expand Down
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
#
amclient==1.3.0
# via -r requirements.in
certifi==2023.11.17
certifi==2024.7.4
# via requests
charset-normalizer==3.3.2
# via requests
greenlet==3.0.1
greenlet==3.0.3
# via sqlalchemy
idna==3.4
idna==3.7
# via requests
lxml==4.9.3
lxml==5.2.2
# via metsrw
metsrw==0.5.0
metsrw==0.5.1
# via -r requirements.in
requests==2.31.0
requests==2.32.3
# via
# -r requirements.in
# amclient
sqlalchemy==1.4.50
sqlalchemy==1.4.52
# via -r requirements.in
urllib3==2.1.0
urllib3==2.2.2
# via
# -r requirements.in
# amclient
Expand Down
19 changes: 19 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[lint]
# Rule reference: https://docs.astral.sh/ruff/rules/
select = [
"B",
"C4",
"E",
"F",
"I",
"UP",
"W",
]
ignore = [
"B904",
"E501",
"UP031",
]

[lint.isort]
force-single-line = true
5 changes: 2 additions & 3 deletions tests/test_create_avalon_dip.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from aips import create_dip


SS_URL = "http://127.0.0.1:62081"
SS_USER_NAME = "test"
SS_API_KEY = "test"
Expand Down Expand Up @@ -68,8 +67,8 @@ def test_create_avalon_dip_success(_get, tmp_path):
aip_dir, AVALON_AIP_UUID, output_dir.as_posix(), "atom", "avalon-manifest"
)
# Check DIP structure
assert avalon_dip_dir == "{}/{}/{}".format(
output_dir.as_posix(), TRANSFER_NAME, AVALON_AIP_UUID
assert (
avalon_dip_dir == f"{output_dir.as_posix()}/{TRANSFER_NAME}/{AVALON_AIP_UUID}"
)
assert os.path.isdir(avalon_dip_dir)

Expand Down
1 change: 0 additions & 1 deletion tests/test_create_dip.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from aips import create_dip


SS_URL = "http://192.168.168.192:8000"
SS_USER_NAME = "test"
SS_API_KEY = "7021334bee4c9155c07e531608dd28a9d8039420"
Expand Down
Loading

0 comments on commit 9ab0dba

Please sign in to comment.