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

Allow setting the module name for a pyclass #499

Merged
merged 10 commits into from
Jun 3, 2019
Merged

Allow setting the module name for a pyclass #499

merged 10 commits into from
Jun 3, 2019

Conversation

althonos
Copy link
Member

Following #474, this PR adds an argument for #[pyclass] that lets the user specify the name of the module the class is part of. I also added the right module for all builtin types (either builtins or datetime), with a few tests.

Maintenance
  • Run cargo fmt (This is checked by travis ci) ✅
  • Run cargo clippy and check there are no hard errors (There are a bunch of existing warnings; This is also checked by travis)
  • If applicable, add an entry in the changelog. ✅
  • If applicable, add documentation to all new items and extend the guide. ✅
  • If applicable, add tests for all new or fixed functions ✅

You might want to run tox (pip install tox) locally to check compatibility with all supported python versions. If you're using linux or mac you might find the Makefile helpful for testing.

src/types/mod.rs Show resolved Hide resolved
src/types/mod.rs Show resolved Hide resolved
@kngwyu
Copy link
Member

kngwyu commented May 31, 2019

Thanks, I think it's a really meaningful enhancement for us, but left comments about the coding.
In addition, I want a test in which we check that the module name is correctly set.

@althonos
Copy link
Member Author

I forgot to push the latest commits with changelog expansion and tests for the module name, will do that when I can.

@codecov
Copy link

codecov bot commented Jun 1, 2019

Codecov Report

Merging #499 into master will decrease coverage by 0.25%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #499      +/-   ##
==========================================
- Coverage    87.8%   87.54%   -0.26%     
==========================================
  Files          65       65              
  Lines        3435     3428       -7     
==========================================
- Hits         3016     3001      -15     
- Misses        419      427       +8
Impacted Files Coverage Δ
src/types/slice.rs 95.65% <ø> (ø) ⬆️
src/types/num.rs 96% <ø> (ø) ⬆️
src/types/datetime.rs 100% <ø> (ø) ⬆️
src/types/module.rs 89.39% <ø> (ø) ⬆️
src/types/boolobject.rs 100% <ø> (ø) ⬆️
src/types/dict.rs 93.33% <ø> (ø) ⬆️
src/types/bytearray.rs 95.45% <ø> (ø) ⬆️
src/types/typeobject.rs 92% <ø> (ø) ⬆️
src/types/complex.rs 100% <ø> (ø) ⬆️
src/types/tuple.rs 90% <ø> (ø) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed52d57...a8e6a02. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 1, 2019

Codecov Report

Merging #499 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #499   +/-   ##
======================================
  Coverage    87.8%   87.8%           
======================================
  Files          65      65           
  Lines        3435    3435           
======================================
  Hits         3016    3016           
  Misses        419     419
Impacted Files Coverage Δ
src/types/num.rs 96% <ø> (ø) ⬆️
src/types/datetime.rs 100% <ø> (ø) ⬆️
src/types/mod.rs 100% <ø> (ø) ⬆️
src/types/string.rs 89.83% <ø> (ø) ⬆️
src/types/set.rs 84.61% <ø> (ø) ⬆️
src/type_object.rs 89.09% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed52d57...91af634. Read the comment docs.

@kngwyu
Copy link
Member

kngwyu commented Jun 3, 2019

Thanks! 🎉

@kngwyu kngwyu merged commit 99fdafb into PyO3:master Jun 3, 2019
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.

2 participants