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

Setup #61

Merged
merged 32 commits into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
313e9d1
ignore virtual environments
jkbecker Mar 31, 2021
8eec28c
basic refactoring for setup
jkbecker Mar 31, 2021
18e771a
cleaning up imports with isort
jkbecker Mar 31, 2021
560831b
adding [dev] and [test] extras, better isort conf
jkbecker Mar 31, 2021
dfa6fcf
slimming down MANIFEST.in
jkbecker Mar 31, 2021
04d7e22
Update setup.cfg
jkbecker Apr 1, 2021
396a457
sorting test imports
jkbecker Apr 1, 2021
461690c
pyfakefs required for tests
jkbecker Apr 1, 2021
8a69612
Merge branch 'setup' of github.com:jkbecker/plotman into setup
jkbecker Apr 1, 2021
251b36c
sorting test imports
jkbecker Apr 1, 2021
08acd29
Implementing @altendky feedback
jkbecker Apr 4, 2021
5188f86
Merge branch 'development' of github.com:ericaltendorf/plotman into s…
jkbecker Apr 4, 2021
5882b75
adding version command
jkbecker Apr 4, 2021
afcd220
updating README
jkbecker Apr 4, 2021
b181bd5
adding install step to CI
jkbecker Apr 4, 2021
ac53a5d
CI setup
jkbecker Apr 4, 2021
ff11e12
Fixing MANIFEST.in (CI Build complaint)
jkbecker Apr 4, 2021
5686c3e
mock is unhappy
jkbecker Apr 4, 2021
1cb15ff
stop mocking me
jkbecker Apr 4, 2021
542a184
Update src/plotman/plotman.py
jkbecker Apr 5, 2021
1570e2f
Update src/plotman/plotman.py
jkbecker Apr 5, 2021
01d4d3f
Update src/plotman/job.py
jkbecker Apr 5, 2021
7b4f434
Merge branch 'development' of github.com:ericaltendorf/plotman into s…
jkbecker Apr 5, 2021
8255db2
Merge branch 'setup' of github.com:jkbecker/plotman into setup
jkbecker Apr 5, 2021
4f97bec
no author-email
jkbecker Apr 5, 2021
8b06c62
Improved install procedure
jkbecker Apr 5, 2021
ed67015
Merge branch 'setup' of github.com:jkbecker/plotman into setup
jkbecker Apr 5, 2021
9810e34
Update README.md
altendky Apr 6, 2021
ecd9d5b
add trailing EOLs
altendky Apr 6, 2021
65797c0
add a stubby setup.py for compatibility
altendky Apr 6, 2021
34000cf
Update README.md
altendky Apr 6, 2021
fceb2be
Merge branch 'development' into setup
altendky Apr 6, 2021
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__pycache__
venv
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CHANGELOG.md
LICENSE
README.md
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.1
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
65 changes: 65 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[metadata]
name = plotman
version = file: VERSION
author = Eric Altendorf
author-email = PLACEHOLDER
jkbecker marked this conversation as resolved.
Show resolved Hide resolved
home-page = https://github.com/ericaltendorf/plotman
description = Chia plotting manager
long-description = file: README.md
long_description_content_type = text/markdown
license = Apache 2.0
license-file = LICENSE
platform = any
jkbecker marked this conversation as resolved.
Show resolved Hide resolved
keywords = chia, blockchain, automation, process management
classifiers =
Development Status :: 3 - Alpha
Environment :: Console :: Curses
Intended Audience :: Developers
Intended Audience :: System Administrators
Intended Audience :: Information Technology
License :: OSI Approved :: Apache Software License
Natural Language :: English
Operating System :: OS Independent
Programming Language :: Python :: 3
Topic :: Office/Business :: Scheduling
jkbecker marked this conversation as resolved.
Show resolved Hide resolved
Topic :: System :: Monitoring
Topic :: System :: Systems Administration
Topic :: Utilities
project_urls =
Bug Tracker = https://github.com/ericaltendorf/plotman/issues
Changelog = https://github.com/ericaltendorf/plotman/blob/main/CHANGELOG.md

[options]
package_dir=
=src
packages=find:
setup_requires =
setuptools
jkbecker marked this conversation as resolved.
Show resolved Hide resolved
install_requires =
psutil
pyyaml
texttable

[options.packages.find]
where=src

[options.entry_points]
console_scripts =
plotman = plotman.plotman:main

[options.extras_require]
dev =
%(test)s
isort
test =
pytest

[options.data_files]
config = config.yaml
bin = util/listlogs

[isort]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
line_length=88
Empty file added src/plotman/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions archive_test.py → src/plotman/_tests/archive_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import archive
import manager
from plotman import archive, manager


def test_compute_priority():
assert (archive.compute_priority( (3, 1), 1000, 10) >
Expand Down
5 changes: 3 additions & 2 deletions manager_test.py → src/plotman/_tests/manager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
from unittest.mock import patch

import pytest
import manager
import job

from plotman import job, manager


@pytest.fixture
def sched_cfg():
Expand Down
6 changes: 3 additions & 3 deletions plot_util_test.py → src/plotman/_tests/plot_util_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from plot_util import GB

import os
import pyfakefs

import plot_util
import pyfakefs
from plot_util import GB


def test_human_format():
assert (plot_util.human_format(3442000000, 0) == '3G')
Expand Down
4 changes: 2 additions & 2 deletions reporting_test.py → src/plotman/_tests/reporting_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# TODO: migrate away from unittest patch
from unittest.mock import patch

import os
from unittest.mock import patch

import reporting


def test_phases_str():
assert(reporting.phases_str([(1,2), (2,3), (3,4), (4,0)]) ==
'1:2 2:3 3:4 4:0')
Expand Down
4 changes: 3 additions & 1 deletion analyzer.py → src/plotman/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import re
import statistics
import sys

import texttable as tt

import plot_util
from plotman import plot_util


class LogAnalyzer:
# Map from key (e.g. logdir or the like) to (map from measurement name to list of values)
Expand Down
11 changes: 5 additions & 6 deletions archive.py → src/plotman/archive.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from datetime import datetime
import subprocess
import argparse
import math
import os
import psutil
import re
import random
import re
import subprocess
import sys
from datetime import datetime

import psutil
import texttable as tt

import manager
import plot_util
from plotman import manager, plot_util

# TODO : write-protect and delete-protect archived plots

Expand Down
8 changes: 4 additions & 4 deletions interactive.py → src/plotman/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import os
import subprocess
import threading

import yaml

from job import Job
import archive
import manager
import reporting
from plotman import archive, manager, reporting
from plotman.job import Job


class Log:
def __init__(self):
Expand Down
15 changes: 8 additions & 7 deletions job.py → src/plotman/job.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# TODO do we use all these?
from datetime import datetime
from enum import Enum, auto
from subprocess import call
import argparse

import contextlib
import logging
import os
import random
import re
import sys
import threading
import time
import psutil # apt-get install python-psutil
import random
import sys
from datetime import datetime
from enum import Enum, auto
from subprocess import call

import psutil # apt-get install python-psutil
jkbecker marked this conversation as resolved.
Show resolved Hide resolved


def job_phases_for_tmpdir(d, all_jobs):
'''Return phase 2-tuples for jobs running on tmpdir d'''
Expand Down
18 changes: 9 additions & 9 deletions manager.py → src/plotman/manager.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
from datetime import datetime

import logging
import operator
import os
import random
import re
import readline # For nice CLI
import subprocess
import sys
import threading
import time
from datetime import datetime

import psutil
import random
import readline # For nice CLI
import subprocess
import sys

# Plotman libraries
import job
import plot_util
import archive # for get_archdir_freebytes(). TODO: move to avoid import loop
from plotman import \
archive # for get_archdir_freebytes(). TODO: move to avoid import loop
from plotman import job, plot_util

# Constants
MIN = 60 # Seconds
Expand Down
File renamed without changes.
26 changes: 12 additions & 14 deletions plotman.py → src/plotman/plotman.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
#!/usr/bin/env python3

from datetime import datetime
from subprocess import call

import argparse
import os
import re
import threading
import random
import readline # For nice CLI
import re
import readline # For nice CLI
import sys
import threading
import time
from datetime import datetime
from subprocess import call

import yaml

# Plotman libraries
from job import Job
import analyzer
import archive
import interactive
import manager
import plot_util
import reporting
from plotman import analyzer, archive, interactive, manager, plot_util, reporting
from plotman.job import Job


class PlotmanArgParser:
def add_idprefix_arg(self, subparser):
Expand Down Expand Up @@ -79,7 +75,7 @@ def get_term_width():
columns = 120 # 80 is typically too narrow. TODO: make a command line arg.
return columns

if __name__ == "__main__":
def main():
random.seed()

pm_parser = PlotmanArgParser()
Expand Down Expand Up @@ -202,3 +198,5 @@ def get_term_width():
print('Resuming ' + job.plot_id)
job.resume()

if __name__ == "__main__":
main()
jkbecker marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 5 additions & 6 deletions reporting.py → src/plotman/reporting.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import texttable as tt # from somewhere?
import math
import os

import psutil
import texttable as tt # from somewhere?

from plotman import archive, job, manager, plot_util

import archive
import job
import manager
import math
import plot_util

def abbr_path(path, putative_prefix):
if putative_prefix and path.startswith(putative_prefix):
Expand Down
0 listlogs → util/listlogs
100644 → 100755
File renamed without changes.