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

Convert module to a package directory with a py.typed file #102

Merged
merged 1 commit into from
Jun 11, 2024
Merged

Convert module to a package directory with a py.typed file #102

merged 1 commit into from
Jun 11, 2024

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Jun 11, 2024

The module needs to be converted to a package directory so that it can contain a py.typed file, which is necessary so that mypy can type-check uses of duct items in the test code.

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.46%. Comparing base (83beb34) to head (a9ad991).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
+ Coverage   88.42%   88.46%   +0.03%     
==========================================
  Files           1        2       +1     
  Lines         311      312       +1     
  Branches       41       41              
==========================================
+ Hits          275      276       +1     
  Misses         30       30              
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jwodder jwodder marked this pull request as ready for review June 11, 2024 18:43
Copy link
Member

@asmacdo asmacdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, however @yarikoptic (at least when we first started) wanted the whole thing in a single python file that could be executed directly without even needing to install anything, including duct itself.

I guess we could move version back to main? This looks more idiomatic though, @yarikoptic do you still want "executable as a single file script" to be a requirement?

@yarikoptic
Copy link
Member

So we might indeed refactor it to reside in multiple files but not sure if we are reaching threshold yet -- couldn't we substitute __version__ within __main__.py directly (if you really want to be able to python -m duct it)

@jwodder
Copy link
Member Author

jwodder commented Jun 11, 2024

The biggest benefit to putting __version__ in __init__.py is that it'll show up when users do pydoc duct. Other than that, it's mostly just tradition.

@asmacdo
Copy link
Member

asmacdo commented Jun 11, 2024

I'd vote to go ahead and leave 'version' in 'init' so we don't build up weirdness to address later. If the no-install use case is requested by users maybe we revisit?

@yarikoptic
Copy link
Member

ok

@yarikoptic yarikoptic merged commit 411b77a into con:main Jun 11, 2024
30 checks passed
@jwodder jwodder deleted the pkgfolder branch June 12, 2024 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants