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

Remove lxml #939

Merged
merged 1 commit into from Nov 30, 2022
Merged

Remove lxml #939

merged 1 commit into from Nov 30, 2022

Conversation

thomasdorch
Copy link
Contributor

Hi @joamatab,

The lxml module makes parsing xml simpler but it also requires a compiled C-extension, which is causing issues when migrating to 3.11. This PR removes lxml and replaces it with the built-in xml modules.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 30, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.98%.

Quality metrics Before After Change
Complexity 7.43 ⭐ 7.37 ⭐ -0.06 👍
Method Length 78.67 🙂 76.34 🙂 -2.33 👍
Working memory 9.41 🙂 9.16 🙂 -0.25 👍
Quality 62.08% 🙂 63.06% 🙂 0.98% 👍
Other metrics Before After Change
Lines 622 630 8
Changed files Quality Before Quality After Quality Change
gdsfactory/klayout_tech.py 62.08% 🙂 63.06% 🙂 0.98% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
gdsfactory/klayout_tech.py KLayoutTechnology.export_technology_files 17 🙂 447 ⛔ 18 ⛔ 24.05% ⛔ Try splitting into smaller methods. Extract out complex expressions
gdsfactory/klayout_tech.py LayerView._get_xml_element 16 🙂 142 😞 12 😞 45.28% 😞 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/klayout_tech.py LayerDisplayProperties.from_lyp 12 🙂 217 ⛔ 9 🙂 47.75% 😞 Try splitting into smaller methods
gdsfactory/klayout_tech.py LayerView.color_is_valid 10 🙂 130 😞 11 😞 53.56% 🙂 Try splitting into smaller methods. Extract out complex expressions
gdsfactory/klayout_tech.py _properties_to_layerview 11 🙂 130 😞 10 😞 54.55% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@thomasdorch thomasdorch changed the title remove lxml Remove lxml Nov 30, 2022
@joamatab
Copy link
Contributor

Thank you Thomas,

looking forward to trying gdsfactory on python3.11

@joamatab joamatab merged commit 6a73f54 into gdsfactory:master Nov 30, 2022
@joamatab
Copy link
Contributor

Just released v6.3.4 which should be python3.11 compatible

@SkandanC

@thomasdorch thomasdorch deleted the remove-lxml branch January 7, 2023 23:16
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.

None yet

2 participants