Skip to content

Commit

Permalink
Merge pull request #57 from mrc-ide/rename-all
Browse files Browse the repository at this point in the history
Rename project to pyorderly.
  • Loading branch information
richfitz authored Aug 19, 2024
2 parents b25e84b + b8c900b commit 486c4cd
Show file tree
Hide file tree
Showing 77 changed files with 284 additions and 260 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Test install
run: |
pip install .
python -c "import orderly; import outpack"
python -c "import pyorderly"
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# outpack
# pyorderly

[![PyPI - Version](https://img.shields.io/pypi/v/outpack.svg)](https://pypi.org/project/outpack)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/outpack.svg)](https://pypi.org/project/outpack)
[![PyPI - Version](https://img.shields.io/pypi/v/pyorderly.svg)](https://pypi.org/project/pyorderly)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyorderly.svg)](https://pypi.org/project/pyorderly)

-----

Expand All @@ -13,7 +13,7 @@
## Installation

```console
pip install outpack
pip install pyorderly
```

## Development
Expand All @@ -33,7 +33,7 @@ hatch run lint:fmt
The outpack query parser is implemented in Rust as part of the
[outpack_server](https://github.com/mrc-ide/outpack_server) repository. When
developing new features in the query parser, they can be tested out in your
development environment of `outpack-py` by installing the parser from your local
development environment of `pyorderly` by installing the parser from your local
checkout:

```
Expand All @@ -43,4 +43,4 @@ hatch run pip install /path/to/outpack_server

## License

`outpack` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
`pyorderly` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import outpack.__about__ as info
import pyorderly.__about__ as info

project = info.__name__
copyright = "2023-present Imperial College of Science, Technology and Medicine"
Expand Down
17 changes: 7 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "outpack"
name = "pyorderly"
dynamic = ["version"]
description = "Reproducible and collaborative reporting"
readme = "README.md"
Expand Down Expand Up @@ -36,15 +36,12 @@ dependencies = [
]

[project.urls]
Documentation = "https://github.com/mrc-ide/outpack#readme"
Issues = "https://github.com/mrc-ide/outpack/issues"
Source = "https://github.com/mrc-ide/outpack"
Documentation = "https://github.com/mrc-ide/pyorderly#readme"
Issues = "https://github.com/mrc-ide/pyorderly/issues"
Source = "https://github.com/mrc-ide/pyorderly"

[tool.hatch.version]
path = "src/outpack/__about__.py"

[tool.hatch.build.targets.wheel]
packages = ["src/outpack", "src/orderly"]
path = "src/pyorderly/__about__.py"

[tool.hatch.envs.default]
dependencies = [
Expand Down Expand Up @@ -177,14 +174,14 @@ ban-relative-imports = "all"
convention = "numpy"

[tool.coverage.run]
source_pkgs = ["outpack", "orderly", "tests"]
source_pkgs = ["pyorderly", "tests"]
branch = true
parallel = true

# The wildcards are needed in order for the omit path to work correctly even
# when spawning subprocess in different directories.
omit = [
"**/src/outpack/__about__.py",
"**/src/pyorderly/__about__.py",
"**/tests/helpers/*",
]

Expand Down
2 changes: 1 addition & 1 deletion scripts/update_schemas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ schema_version <-
jsonlite::read_json(file.path(tmp, "schema", "config.json"))$version

fs::dir_copy(file.path(tmp, "schema"), dest)
writeLines(c("# Imported from outpack",
writeLines(c("# Imported from pyorderly.outpack",
"",
sprintf("* Schema version %s", schema_version),
sprintf("* Imported on %s", Sys.time()),
Expand Down
2 changes: 1 addition & 1 deletion src/outpack/__about__.py → src/pyorderly/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# SPDX-License-Identifier: MIT
__version__ = "0.0.1"
__name__ = "outpack-py"
__name__ = "pyorderly"
2 changes: 1 addition & 1 deletion src/orderly/__init__.py → src/pyorderly/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from orderly.core import (
from pyorderly.core import (
Parameters,
artefact,
dependency,
Expand Down
10 changes: 5 additions & 5 deletions src/orderly/core.py → src/pyorderly/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

from dataclasses_json import dataclass_json

from orderly.current import get_active_context
from outpack import util
from outpack.copy_files import copy_files
from outpack.search import search_unique
from outpack.util import pl
from pyorderly.current import get_active_context
from pyorderly.outpack import util
from pyorderly.outpack.copy_files import copy_files
from pyorderly.outpack.search import search_unique
from pyorderly.outpack.util import pl


@dataclass_json()
Expand Down
6 changes: 3 additions & 3 deletions src/orderly/current.py → src/pyorderly/current.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from pathlib import Path
from typing import Optional

from outpack.packet import Packet
from outpack.root import OutpackRoot, root_open
from outpack.search_options import SearchOptions
from pyorderly.outpack.packet import Packet
from pyorderly.outpack.root import OutpackRoot, root_open
from pyorderly.outpack.search_options import SearchOptions


class OrderlyCustomMetadata:
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/outpack/config.py → src/pyorderly/outpack/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from dataclasses_json import config, dataclass_json

from outpack.schema import outpack_schema_version
from outpack.static import LOCATION_TYPES
from outpack.util import match_value
from pyorderly.outpack.schema import outpack_schema_version
from pyorderly.outpack.static import LOCATION_TYPES
from pyorderly.outpack.util import match_value


def read_config(root_path):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from pathlib import Path
from typing import Dict

from outpack.location_pull import (
from pyorderly.outpack.location_pull import (
location_build_pull_plan,
location_pull_files,
)
from outpack.metadata import PacketFile
from outpack.root import OutpackRoot
from outpack.search_options import SearchOptions
from pyorderly.outpack.metadata import PacketFile
from pyorderly.outpack.root import OutpackRoot
from pyorderly.outpack.search_options import SearchOptions


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from errno import ENOENT
from pathlib import Path

from outpack.hash import Hash, hash_parse, hash_validate_file
from outpack.util import openable_temporary_file
from pyorderly.outpack.hash import Hash, hash_parse, hash_validate_file
from pyorderly.outpack.util import openable_temporary_file


class FileStore:
Expand Down Expand Up @@ -79,8 +79,6 @@ def onerror(func, path, _exc_info):
if not os.access(path, os.W_OK):
os.chmod(path, stat.S_IWUSR)
func(path)
else:
raise

shutil.rmtree(self._path, onerror=onerror)

Expand Down
2 changes: 1 addition & 1 deletion src/outpack/hash.py → src/pyorderly/outpack/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def hash_string(data, algorithm):


def hash_parse(string):
if type(string) == Hash:
if isinstance(string, Hash):
return string
return Hash(*string.split(":"))

Expand Down
2 changes: 1 addition & 1 deletion src/outpack/ids.py → src/pyorderly/outpack/ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import secrets
import time

from outpack.util import iso_time_str
from pyorderly.outpack.util import iso_time_str

RE_ID = re.compile("^[0-9]{8}-[0-9]{6}-[0-9a-f]{8}$")

Expand Down
2 changes: 1 addition & 1 deletion src/outpack/index.py → src/pyorderly/outpack/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dataclasses import dataclass
from typing import Dict, List

from outpack.metadata import (
from pyorderly.outpack.metadata import (
MetadataCore,
PacketLocation,
read_metadata_core,
Expand Down
2 changes: 1 addition & 1 deletion src/outpack/init.py → src/pyorderly/outpack/init.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path

from outpack.config import Config, read_config, write_config
from pyorderly.outpack.config import Config, read_config, write_config


def outpack_init(
Expand Down
12 changes: 6 additions & 6 deletions src/outpack/location.py → src/pyorderly/outpack/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import shutil
from pathlib import PurePath

from outpack.config import Location, update_config
from outpack.location_driver import LocationDriver
from outpack.location_path import OutpackLocationPath
from outpack.location_ssh import OutpackLocationSSH, parse_ssh_url
from outpack.root import OutpackRoot, root_open
from outpack.static import (
from pyorderly.outpack.config import Location, update_config
from pyorderly.outpack.location_driver import LocationDriver
from pyorderly.outpack.location_path import OutpackLocationPath
from pyorderly.outpack.location_ssh import OutpackLocationSSH, parse_ssh_url
from pyorderly.outpack.root import OutpackRoot, root_open
from pyorderly.outpack.static import (
LOCATION_LOCAL,
LOCATION_ORPHAN,
LOCATION_RESERVED_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from contextlib import AbstractContextManager
from typing import Dict, List

from outpack.metadata import MetadataCore, PacketFile, PacketLocation
from pyorderly.outpack.metadata import MetadataCore, PacketFile, PacketLocation


class LocationDriver(AbstractContextManager):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import shutil
from typing import Dict, List

from outpack.location_driver import LocationDriver
from outpack.metadata import MetadataCore, PacketFile, PacketLocation
from outpack.root import find_file_by_hash, root_open
from outpack.static import LOCATION_LOCAL
from outpack.util import read_string
from pyorderly.outpack.location_driver import LocationDriver
from pyorderly.outpack.metadata import MetadataCore, PacketFile, PacketLocation
from pyorderly.outpack.root import find_file_by_hash, root_open
from pyorderly.outpack.static import LOCATION_LOCAL
from pyorderly.outpack.util import read_string


class OutpackLocationPath(LocationDriver):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,27 @@

import humanize

from outpack.filestore import FileStore
from outpack.hash import hash_validate_string
from outpack.location import (
from pyorderly.outpack.filestore import FileStore
from pyorderly.outpack.hash import hash_validate_string
from pyorderly.outpack.location import (
LocationDriver,
_location_driver,
location_resolve_valid,
)
from outpack.metadata import (
from pyorderly.outpack.metadata import (
MetadataCore,
PacketFileWithLocation,
PacketLocation,
)
from outpack.root import OutpackRoot, find_file_by_hash, mark_known, root_open
from outpack.search_options import SearchOptions
from outpack.static import LOCATION_LOCAL
from outpack.util import format_list, partition, pl
from pyorderly.outpack.root import (
OutpackRoot,
find_file_by_hash,
mark_known,
root_open,
)
from pyorderly.outpack.search_options import SearchOptions
from pyorderly.outpack.static import LOCATION_LOCAL
from pyorderly.outpack.util import format_list, partition, pl


def outpack_location_pull_metadata(location=None, root=None, *, locate=True):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import paramiko

from outpack.config import Config
from outpack.hash import hash_parse
from outpack.location_driver import LocationDriver
from outpack.metadata import MetadataCore, PacketFile, PacketLocation
from outpack.static import LOCATION_LOCAL
from outpack.util import removeprefix
from pyorderly.outpack.config import Config
from pyorderly.outpack.hash import hash_parse
from pyorderly.outpack.location_driver import LocationDriver
from pyorderly.outpack.metadata import MetadataCore, PacketFile, PacketLocation
from pyorderly.outpack.static import LOCATION_LOCAL
from pyorderly.outpack.util import removeprefix


def parse_ssh_url(url):
Expand Down
4 changes: 2 additions & 2 deletions src/outpack/metadata.py → src/pyorderly/outpack/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from dataclasses_json import dataclass_json

from outpack.hash import hash_file
from outpack.tools import GitInfo
from pyorderly.outpack.hash import hash_file
from pyorderly.outpack.tools import GitInfo


@dataclass_json()
Expand Down
25 changes: 15 additions & 10 deletions src/outpack/packet.py → src/pyorderly/outpack/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@
import time
from pathlib import Path

from outpack.copy_files import copy_files
from outpack.hash import hash_file, hash_parse, hash_string, hash_validate_file
from outpack.ids import outpack_id, validate_outpack_id
from outpack.location_pull import outpack_location_pull_packet
from outpack.metadata import (
from pyorderly.outpack.copy_files import copy_files
from pyorderly.outpack.hash import (
hash_file,
hash_parse,
hash_string,
hash_validate_file,
)
from pyorderly.outpack.ids import outpack_id, validate_outpack_id
from pyorderly.outpack.location_pull import outpack_location_pull_packet
from pyorderly.outpack.metadata import (
MetadataCore,
PacketDepends,
PacketFile,
)
from outpack.root import mark_known, root_open
from outpack.schema import outpack_schema_version, validate
from outpack.search import as_query, search_unique
from outpack.tools import git_info
from outpack.util import all_normal_files, as_posix_path
from pyorderly.outpack.root import mark_known, root_open
from pyorderly.outpack.schema import outpack_schema_version, validate
from pyorderly.outpack.search import as_query, search_unique
from pyorderly.outpack.tools import git_info
from pyorderly.outpack.util import all_normal_files, as_posix_path


# TODO: most of these fields should be private.
Expand Down
Loading

0 comments on commit 486c4cd

Please sign in to comment.