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

ocap discipline aided by static typing #24

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Commits on Sep 20, 2016

  1. bulk edit: os.path(), open() -> pathlib API

    edit tool is [pathlib_edit.py][1]
    
    Two tweaks in repository.py were done manually.
    
    [1]: https://gist.github.com/dckc/40c8caf4c1dc0027ac0d3b1fdbb251d2
    dckc committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    76eaed3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    676dc70 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7e0c2d9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a7e8cc0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    49eb9eb View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    dafbb5d View commit details
    Browse the repository at this point in the history
  7. src/rpm: conventional (PEP8) whitespace style

      - 4 space indentation
      - 79 characater line length
    dckc committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    be5b212 View commit details
    Browse the repository at this point in the history
  8. use pkgutil.get_data for config resources

    While get_data(), like import, is actually runtime I/O,
    we consider access to design-time constants as if it
    were access to any other static data (string, integer, ...).
    dckc committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    b657d13 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ed67148 View commit details
    Browse the repository at this point in the history
  10. distfile: use object capability discipline

      - no powerful imports: os, subprocess, ...
        - copyfileobj is powerless: file access is passed in
        - PurePosixPath for syntax manipulation is also powerless
      - use PathExt rather than strings for access to files
        - allfiles KLUDGE: navigation thru absolute paths
        - PathTFix.__truediv__ Self type work-around (for p / sub)
        - cast .iterdir() result because our Self type work-around
          isn't smart enough
        - open() -> path.open()
      - pass urlopen, subprocess, random to Distfile as a distfile.Access
        - simplify, export UrlopenFn: always returns BinaryIO
        - util.RunCommand class represents subprocess interface
        - declare type for util.diff mkPopen arg
      - Distfile.__init__() static types (e.g. Hash) help with refactoring
        - complete static types for all Distfile methods
      - log.warning() is only declared to take a str. hm.
    dckc committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    93dcccd View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    583b758 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    4427e05 View commit details
    Browse the repository at this point in the history
  13. src.builder: explicit authority, static types

      - DiffCreator gets subprocess
      - BuildDirectory gets platform
      - FileHandle etc. get an Access (subprocess etc.)
        - add check_output to RunCommand interface
      - Builder interface common to HostBuilder and TargetBuilder
      - refactor allpath KLUDGE using PathExt.platform() and
        config.config_path_fn
        - use single-assignment idiom for tar vs bsdtar
      - prune resource_directory
        - restore DIR_RESOURCES but only as a PurePath for use with check_call()
      - Distfile needs a RandomT
      - never mind PathTFix generic Self
        It didn't work -- turned into Any -- and hid a few type errors.
    dckc committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    06ff4cb View commit details
    Browse the repository at this point in the history
  14. src.repository: ocap discipline, static types

      - static types rather than **kwargs for op_distfile etc.
      - NamedTuple rather than dict for deferred package info
      - types for version (sometimes a class), checksum (always str)
        - class AnyVersion reifies type common to SimpleVersion, FullVersion
      - master_sites, patches are Set[str], not List[str]
      - move `build_depends = set()` to else branch to help mypy
      - clarify builder.Access name
      - prune more resource_directory dead code
    dckc committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    aa5281c View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    32160de View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    78fa349 View commit details
    Browse the repository at this point in the history
  17. distfile: PEP8 style

      - two blank lines before class, def
      - 4 space indent
      - 79 character line limit
    dckc committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    26d3597 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    1c8d9b0 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    3c60d52 View commit details
    Browse the repository at this point in the history
  20. src/catalog: style tweaks; prune unused items

      - unused: SimpleVersion, lib_depends, files
      - two lines before class
      - spaces around / and after :
      - }); formatting
    dckc committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    e40cb5b View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    12dc43c View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    0b61347 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2016

  1. Configuration menu
    Copy the full SHA
    ee53b09 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a4c8c2e View commit details
    Browse the repository at this point in the history
  3. test_get_target_packages(), trivial case

    run with `py.test`, for example
    dckc committed Sep 21, 2016
    Configuration menu
    Copy the full SHA
    db99f02 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    444094a View commit details
    Browse the repository at this point in the history
  5. fix scope of random in get_starget_packages

    found through unit testing
    dckc committed Sep 21, 2016
    Configuration menu
    Copy the full SHA
    b079ac7 View commit details
    Browse the repository at this point in the history
  6. declare packages/** as design-time test data

    add __init__.py for use with pkgutil.get_data
    
    perhaps a bit of a kludge? but a harmless one
    dckc committed Sep 21, 2016
    Configuration menu
    Copy the full SHA
    75c2b84 View commit details
    Browse the repository at this point in the history
  7. factor mock_io out of test_suite

    and move test_suite into `src` dir
    dckc committed Sep 21, 2016
    Configuration menu
    Copy the full SHA
    0ba5835 View commit details
    Browse the repository at this point in the history