I've just created a (draft) PR for adding a `pypro...
# contribute
i
I've just created a (draft) PR for adding a
pyproject.toml
. Will appreciate any feedback, especially with regard to testing this.
โค๏ธ 2
s
yeah so the
.ci/*.sh
files need to be updated for the tests to be able to run.
Then I think we need to figure out getting the version โ€” right now itโ€™s in
hamilton/version.py
t
For version, we should be able to specify
Copy code
[project]
dynamic = ["version"]

...

[tool.setuptools.dynamic]
version = { attr = hamilton.__version__}
๐Ÿ‘€ 1
i
Getting there...
Screenshot_20240808-000419_Firefox.png
๐Ÿ™Œ 2
What's left to do is cleanup setup.py a bit and I guess we're done
t
note: even though docs were successfully built, we should review them. I browsed through a few pages and it seemed ok!
๐Ÿ™Œ 1
i
Alright, the PR is ready for review/merging!
๐Ÿฟ๏ธ 1
Looks like it's time for ruff...
s
yeah if thereโ€™s a lot of reformatting โ€” we can hide that commit here https://github.com/DAGWorks-Inc/hamilton/blob/main/.git-blame-ignore-revs
t
Awesome to see this change merged! thanks a lot
๐Ÿ™ 1
i
I think I'll initially add ruff with minimal checks, then one of you guys could enable them one by one to see if the changes are reasonable. I think when I ran it locally with the current list of checks, it made over 600 modifications
s
Cool - we could maybe get it done during one of the Hamilton office hours?
i
what, next week? yeah, maybe
In case anyone's curious, this is what happens when running ruff on the entire codebase with all checks on (
ruff check --statistics --select ALL
):
Copy code
3055    FA100   [ ] future-rewritable-type-annotation
1561    COM812  [*] missing-trailing-comma
1555    D103    [ ] undocumented-public-function
1366    ANN201  [ ] missing-return-type-undocumented-public-function
1310    D401    [ ] non-imperative-mood
1305    E501    [ ] line-too-long
1068    D400    [ ] ends-in-period
1054    D415    [ ] ends-in-punctuation
 752    D205    [ ] blank-line-after-summary
 733    ANN001  [ ] missing-type-function-argument
 680    D102    [ ] undocumented-public-method
 561    D100    [ ] undocumented-public-module
 449    ERA001  [*] commented-out-code
 416    S101    [ ] assert
 398    I001    [*] unsorted-imports
 322    D101    [ ] undocumented-public-class
 294    C408    [*] unnecessary-collection-call
 290    TRY003  [ ] raise-vanilla-args
 282    PLR2004 [ ] magic-value-comparison
 271    FA102   [*] future-required-type-annotation
 261    INP001  [ ] implicit-namespace-package
 257    G004    [ ] logging-f-string
 256    ANN401  [ ] any-type
 253    ARG001  [ ] unused-function-argument
 242    T201    [*] print
 231    ANN202  [ ] missing-return-type-private-function
 226    EM102   [*] f-string-in-exception
 222    FIX002  [ ] line-contains-todo
 222    TD002   [ ] missing-todo-author
 221    TD003   [ ] missing-todo-link
 201    ANN204  [ ] missing-return-type-special-method
 198    ARG002  [ ] unused-method-argument
 190    PD901   [ ] pandas-df-variable-name
 187    RET504  [*] unnecessary-assign
 187    TD004   [ ] missing-todo-colon
 174    RUF013  [*] implicit-optional
 161    FBT001  [ ] boolean-type-hint-positional-argument
 150    D404    [ ] docstring-starts-with-this
 140    SLF001  [ ] private-member-access
 134    ANN003  [ ] missing-type-kwargs
 133    D212    [*] multi-line-summary-first-line
 127    D104    [ ] undocumented-public-package
 126    N806    [ ] non-lowercase-variable-in-function
 121    FBT002  [ ] boolean-default-value-positional-argument
 115    EM101   [*] raw-string-in-exception
 110    PIE790  [*] unnecessary-placeholder
 109    PLR0913 [ ] too-many-arguments
 101    E402    [ ] module-import-not-at-top-of-file
  94    D202    [*] no-blank-line-after-function
  92    PTH118  [ ] os-path-join
  92    N803    [ ] invalid-argument-name
  91    PTH123  [ ] builtin-open
  76    N802    [ ] invalid-function-name
  76    D407    [*] dashed-underline-after-section
  73    PT023   [*] pytest-incorrect-mark-parentheses-style
  73    D209    [*] new-line-after-last-paragraph
  69    PT006   [*] pytest-parametrize-names-wrong-type
  63    N801    [ ] invalid-class-name
  58    D107    [ ] undocumented-public-init
  56    RUF012  [ ] mutable-class-default
  51    C901    [ ] complex-structure
  48    D403    [*] first-line-capitalized
  47    RET505  [ ] superfluous-else-return
  46    UP008   [*] super-call-with-parameters
  45    D413    [*] blank-line-after-last-section
  43    D106    [ ] undocumented-public-nested-class
  41    PT001   [*] pytest-fixture-incorrect-parentheses-style
  41    D105    [ ] undocumented-magic-method
  41    D200    [*] fits-on-one-line
  40    BLE001  [ ] blind-except
  40    PT011   [ ] pytest-raises-too-broad
  39    B904    [ ] raise-without-from-inside-except
  38    ANN002  [ ] missing-type-args
  36    A002    [ ] builtin-argument-shadowing
  36    PTH110  [ ] os-path-exists
  34    S113    [ ] request-without-timeout
  33    B007    [ ] unused-loop-control-variable
  33    DTZ005  [ ] call-datetime-now-without-tzinfo
  31    FBT003  [ ] boolean-positional-value-in-call
  29    T203    [*] p-print
  27    PERF401 [ ] manual-list-comprehension
  25    E721    [ ] type-comparison
  25    PLR0912 [ ] too-many-branches
  25    TRY201  [*] verbose-raise
  23    PLW2901 [ ] redefined-loop-name
  23    UP015   [*] redundant-open-modes
  23    TRY400  [*] error-instead-of-exception
  20    SIM102  [ ] collapsible-if
  20    RUF005  [*] collection-literal-concatenation
  20    RUF100  [*] unused-noqa
  19    ANN205  [ ] missing-return-type-static-method
  19    PGH004  [ ] blanket-noqa
  19    UP028   [*] yield-in-for-loop
  18            [ ] syntax-error
  18    C416    [*] unnecessary-comprehension
  18    ISC001  [ ] single-line-implicit-string-concatenation
  18    PERF102 [*] incorrect-dict-iterator
  17    SIM108  [ ] if-else-block-instead-of-if-exp
  17    D411    [*] no-blank-line-before-section
  16    S311    [ ] suspicious-non-cryptographic-random-usage
  16    A001    [ ] builtin-variable-shadowing
  14    ANN206  [ ] missing-return-type-class-method
  14    B008    [ ] function-call-in-default-argument
  14    ICN001  [ ] unconventional-import-alias
  14    RET503  [*] implicit-return
  14    PTH103  [ ] os-makedirs
  14    D406    [*] new-line-after-section-name
  14    TRY300  [ ] try-consider-else
  13    SIM114  [*] if-with-same-arms
  13    SIM118  [*] in-dict-keys
  13    D301    [*] escape-sequence-in-docstring
  12    S301    [ ] suspicious-pickle-usage
  12    PT012   [ ] pytest-raises-with-multiple-statements
  12    SIM117  [ ] multiple-with-statements
  12    PD011   [ ] pandas-use-of-dot-values
  12    PLR0915 [ ] too-many-statements
  11    B006    [*] mutable-argument-default
  11    DTZ001  [ ] call-datetime-without-tzinfo
  11    PIE810  [*] multiple-starts-ends-with
  11    PYI041  [ ] redundant-numeric-union
  11    RET506  [ ] superfluous-else-raise
  11    TRY002  [ ] raise-vanilla-class
  10    PIE804  [*] unnecessary-dict-kwargs
  10    PT022   [*] pytest-useless-yield-fixture
  10    N818    [ ] error-suffix-on-exception-name
  10    PD015   [ ] pandas-use-of-pd-merge
  10    PLW0603 [ ] global-statement
  10    RUF015  [*] unnecessary-iterable-allocation-for-first-element
   9    S603    [ ] subprocess-without-shell-equals-true
   9    C419    [*] unnecessary-comprehension-in-call
   9    DTZ007  [ ] call-datetime-strptime-without-zone
   9    FIX004  [ ] line-contains-hack
   9    RET502  [*] implicit-return-value
   9    SIM300  [*] yoda-conditions
   9    PD002   [*] pandas-use-of-inplace-argument
   9    D410    [*] no-blank-line-after-section
   9    PLR1714 [*] repeated-equality-comparison
   9    UP032   [*] f-string
   9    RUF010  [*] explicit-f-string-type-conversion
   8    S104    [ ] hardcoded-bind-all-interfaces
   8    DTZ003  [ ] call-datetime-utcnow
   7    S607    [ ] start-process-with-partial-path
   7    RET507  [ ] superfluous-else-continue
   7    SIM113  [ ] enumerate-for-loop
   7    PTH113  [ ] os-path-isfile
   7    TRY004  [ ] type-check-without-type-error
   6    S102    [ ] exec-builtin
   6    C403    [*] unnecessary-list-comprehension-set
   6    PT014   [*] pytest-duplicate-parametrize-test-cases
   6    PT018   [*] pytest-composite-assertion
   6    SIM110  [*] reimplemented-builtin
   6    SIM115  [ ] open-file-with-context-handler
   6    SIM401  [*] if-else-block-instead-of-dict-get
   6    PTH120  [ ] os-path-dirname
   6    N812    [ ] lowercase-imported-as-non-lowercase
   6    N999    [ ] invalid-module-name
   6    PERF203 [ ] try-except-in-loop
   6    RUF002  [ ] ambiguous-unicode-character-docstring
   5    C401    [*] unnecessary-generator-set
   5    C414    [*] unnecessary-double-cast-or-process
   5    T100    [ ] debugger
   5    PIE800  [*] unnecessary-spread
   5    PYI016  [ ] duplicate-union-member
   5    PYI051  [ ] redundant-literal-union
   5    SIM103  [ ] needless-bool
   5    PTH119  [ ] os-path-basename
   5    D417    [ ] undocumented-param
   5    PLR0402 [*] manual-from-import
   5    PLR2044 [*] empty-comment
   5    PLW1510 [*] subprocess-run-without-check
   5    UP034   [*] extraneous-parentheses
   4    C417    [*] unnecessary-map
   4    DJ001   [ ] django-nullable-model-string-field
   4    G001    [ ] logging-string-format
   4    PIE808  [*] unnecessary-range-start
   4    SIM210  [*] if-expr-with-true-false
   4    PTH102  [ ] os-mkdir
   4    PTH109  [ ] os-getcwd
   4    NPY002  [ ] numpy-legacy-random
   4    NPY201  [*] numpy2-deprecation
   4    N811    [ ] constant-imported-as-non-constant
   4    W605    [*] invalid-escape-sequence
   4    D419    [ ] empty-docstring
   4    PGH003  [ ] blanket-type-ignore
   4    PLR0911 [ ] too-many-return-statements
   3    S110    [ ] try-except-pass
   3    S310    [ ] suspicious-url-open-usage
   3    C402    [*] unnecessary-generator-dict
   3    C405    [*] unnecessary-literal-set
   3    PYI030  [*] unnecessary-literal-union
   3    RSE102  [*] unnecessary-paren-on-raise-exception
   3    SIM105  [ ] suppressible-exception
   3    SIM201  [*] negate-equal-op
   3    TCH002  [*] typing-only-third-party-import
   3    ARG005  [ ] unused-lambda-argument
   3    PERF402 [ ] manual-list-copy
   3    W292    [ ] missing-newline-at-end-of-file
   3    D405    [*] capitalize-section-name
   3    D412    [*] blank-lines-between-header-and-content
   3    PLC0414 [*] useless-import-alias
   3    UP006   [*] non-pep585-annotation
   3    UP009   [*] utf8-encoding-declaration
   3    FURB129 [*] readlines-in-for
   3    TRY301  [ ] raise-within-try
   2    S105    [ ] hardcoded-password-string
   2    S106    [ ] hardcoded-password-func-arg
   2    S324    [ ] hashlib-insecure-hash-function
   2    S608    [ ] hardcoded-sql-expression
   2    S701    [ ] jinja2-autoescape-false
   2    B005    [ ] strip-with-multi-characters
   2    B009    [*] get-attr-with-constant
   2    B010    [*] set-attr-with-constant
   2    B018    [ ] useless-expression
   2    B021    [ ] f-string-docstring
   2    B028    [ ] no-explicit-stacklevel
   2    RET501  [*] unnecessary-return-none
   2    SIM101  [*] duplicate-isinstance-call
   2    SIM109  [*] compare-with-tuple
   2    PTH107  [ ] os-remove
   2    PTH111  [ ] os-path-expanduser
   2    PTH206  [ ] os-sep-split
   2    D300    [*] triple-single-quotes
   2    PLR1704 [ ] redefined-argument-from-local
   2    PLR1711 [*] useless-return
   2    PLR5501 [*] collapsible-else-if
   2    PLW0602 [ ] global-variable-not-assigned
   2    UP004   [*] useless-object-inheritance
   2    UP022   [*] replace-stdout-stderr
   2    UP027   [*] unpacked-list-comprehension
   2    UP031   [*] printf-string-formatting
   2    RUF006  [ ] asyncio-dangling-task
   2    RUF017  [*] quadratic-list-summation
   2    TRY401  [ ] verbose-log-message
   1    S103    [ ] bad-file-permissions
   1    B011    [*] assert-false
   1    B020    [ ] loop-variable-overrides-iterator
   1    C413    [*] unnecessary-call-around-sorted
   1    LOG002  [*] invalid-get-logger-argument
   1    PYI024  [ ] collections-named-tuple
   1    PYI032  [*] any-eq-ne-annotation
   1    PT004   [ ] pytest-missing-fixture-name-underscore
   1    PT013   [ ] pytest-incorrect-pytest-import
   1    PT015   [ ] pytest-assert-always-false
   1    PT017   [ ] pytest-assert-in-except
   1    TD005   [ ] missing-todo-description
   1    TD006   [*] invalid-todo-capitalization
   1    TCH003  [*] typing-only-standard-library-import
   1    ARG003  [ ] unused-class-method-argument
   1    PTH101  [ ] os-chmod
   1    PTH122  [ ] os-path-splitext
   1    PTH202  [ ] os-path-getsize
   1    PTH204  [ ] os-path-getmtime
   1    N805    [*] invalid-first-argument-name-for-method
   1    PD003   [ ] pandas-use-of-dot-is-null
   1    PD010   [ ] pandas-use-of-dot-pivot-or-unstack
   1    PERF403 [ ] manual-dict-comprehension
   1    D210    [*] surrounding-whitespace
   1    D402    [ ] no-signature
   1    PLC0132 [ ] type-param-name-mismatch
   1    UP030   [*] format-literals
   1    UP035   [*] deprecated-import
   1    FURB136 [*] if-expr-min-max
   1    RUF001  [ ] ambiguous-unicode-character-string
   1    RUF019  [*] unnecessary-key-check
   1    TRY302  [ ] useless-try-except
๐Ÿคฏ 1
Copy code
18            [ ] syntax-error
๐Ÿคจ
s
yeah I wonder where they are โ€” within dead code blocks?
i
I think those refer to the .py files which are actually symlinks
๐Ÿ‘ 1