Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move code to new locations #56

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading