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

feat: enabling structured package #278

Merged
merged 79 commits into from
Aug 27, 2024
Merged

feat: enabling structured package #278

merged 79 commits into from
Aug 27, 2024

Conversation

clatapie
Copy link
Collaborator

@clatapie clatapie commented Jul 22, 2024

This PR modifies the structure of the created package.

Structure of the package before:

repository
  |  function1.py
  |  function2.py
  |  function3.py
  |  function4.py
  |  function5.py
  |  function6.py

Now:

repository
  |  module1
  |    |  class1.py
  |    |    |  function1
  |    |    |  function2
  |    |    |  function3
  |    |  class2.py
  |    |    |  function4
  |    |    |  function5
  |    |    |  function6

This new structure is directly obtained from the XML repository.

TO DO:

  • fix tests
  • clean up the code

@github-actions github-actions bot added the enhancement New features or code improvements label Jul 22, 2024
Copy link
Contributor

@germa89 germa89 left a comment

Choose a reason for hiding this comment

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

Several comments.

  • Avoid generate the content at the same time you write the file, so you can test the content without writing the file.
  • You do not need to use fid.close if you are working inside a context manager.
  • Readability is important. Please group statements doing an specific function, under a function with proper name. Sometimes the code is difficult to follow if you have many many statements doing "standard" python (not grouped in functions). I mean, you either comment more your code, so we know what is doing each block of statements, or you group that block under a function with a representative name.

src/pyconverter/xml2py/ast_tree.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/ast_tree.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/ast_tree.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/utils.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/utils.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/writer.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/writer.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/writer.py Outdated Show resolved Hide resolved
tests/test_cli.py Outdated Show resolved Hide resolved
tests/test_writer.py Show resolved Hide resolved
@clatapie
Copy link
Collaborator Author

clatapie commented Aug 9, 2024

Thank you very much for your review @PipKat!

Copy link
Contributor

@germa89 germa89 left a comment

Choose a reason for hiding this comment

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

Just a minor remark. Other than that, I trust my past self. xD

src/pyconverter/xml2py/writer.py Outdated Show resolved Hide resolved
Copy link
Member

@RobPasMue RobPasMue left a comment

Choose a reason for hiding this comment

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

Overall LGTM but as you may imagine, I couldn't review in depth all the logic. Left some comments. Request review once solved.

make_package_doc.sh Outdated Show resolved Hide resolved
src/pyconverter/xml2py/utils/regex_pattern.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/utils/utils.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/utils/utils.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/ast_tree.py Show resolved Hide resolved
src/pyconverter/xml2py/writer.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/writer.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/writer.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/writer.py Outdated Show resolved Hide resolved
src/pyconverter/xml2py/writer.py Show resolved Hide resolved
@clatapie
Copy link
Collaborator Author

Type hint has been implemented in most of the package - except in the ast_tree.py module.

Copy link
Member

@RobPasMue RobPasMue left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @clatapie for your hard work on this

@clatapie clatapie merged commit acf329f into main Aug 27, 2024
21 checks passed
@clatapie clatapie deleted the feat/structured_package branch August 27, 2024 08:27
clatapie added a commit that referenced this pull request Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or code improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants