Skip to content

Commit

Permalink
Merge pull request #56 from ganwell/chore-move-code-to-modules
Browse files Browse the repository at this point in the history
chore: move code  to new locations
  • Loading branch information
Jean-Louis Fuchs authored Mar 3, 2024
2 parents ce1fd8c + ab527d0 commit 6f64d4c
Show file tree
Hide file tree
Showing 28 changed files with 2,136 additions and 2,212 deletions.
11 changes: 11 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,14 @@ The reason for this is to ensure the continuity of the git history.
# Do all output via logging module

- Idea show INFO and above, but display info without timestamp etc.

# latest, maybe repeat:

- replace all prints with logging
- correctly do getLogger
- is this unit_or_list... thing still needed
- remove codecs.open
- use pathlib.Path
- replace state_reader.state with function
- remove six
- remote test.py completely
245 changes: 131 additions & 114 deletions poetry.lock

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions pyaptly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@
Configuration is based on toml input files.
"""

from pyaptly.legacy import ( # type: ignore # TODO # noqa: F401
Command,
SystemStateReader,
main,
)
import os


def init_hypothesis():
"""Initialize hypothesis profile if hypothesis is available."""
try: # pragma: no cover
if "HYPOTHESIS_PROFILE" in os.environ:
from hypothesis import settings

settings.register_profile("ci", settings(max_examples=10000))
settings.load_profile(os.getenv("HYPOTHESIS_PROFILE", "default"))
except (ImportError, AttributeError): # pragma: no cover
pass


init_hypothesis()
6 changes: 3 additions & 3 deletions pyaptly/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def cli(debug: bool):
@cli.command(help="run legacy command parser")
def legacy():
"""Run legacy pyaptly cli."""
from pyaptly import main # type: ignore # TODO
from . import main

main()
main.main()


@cli.command(help="convert yaml- to toml-comfig")
Expand Down Expand Up @@ -60,7 +60,7 @@ def legacy():
)
def yaml_to_toml(yaml_path: Path, toml_path: Path, add_defaults: bool):
"""Convert pyaptly config files from yaml to toml."""
from pyaptly import config_file
from . import config_file

config_file.yaml_to_toml(
yaml_path,
Expand Down
Loading

0 comments on commit 6f64d4c

Please sign in to comment.