From e15c0b7d7acdbeff841b532721c766b41fb4894a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 21 Mar 2026 18:46:34 +0100 Subject: [PATCH] Upgrade to pyproject using hatchling as build-system --- .gitlab-ci.yml | 41 +- .gitlab-scripts/check-template-modules.sh | 2 +- .gitlab-scripts/generate-ci.py | 2 +- .gitlab-scripts/generate-doc.sh | 1 - .gitlab-scripts/generate-packages.sh | 4 +- .hgignore | 2 + .hooks/link_modules | 4 +- .hooks/update_requirements | 73 +- README.rst | 8 +- cookiecutter-module/cookiecutter.json | 6 +- cookiecutter-module/hooks/post_gen_project.py | 7 + .../{{ cookiecutter.module_name }}/COPYRIGHT | 2 +- .../doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 89 + .../{{ cookiecutter.module_name }}/setup.py | 149 -- .../{{ cookiecutter.module_name }}/tox.ini | 8 +- doc/conf.py | 14 +- doc/requirements-doc.txt | 1 + modules/account/COPYRIGHT | 8 +- modules/account/MANIFEST.in | 6 - modules/account/doc/conf.py | 22 +- modules/account/doc/requirements-doc.txt | 1 + modules/account/pyproject.toml | 63 + modules/account/setup.py | 132 -- modules/account/tox.ini | 4 +- modules/account_asset/COPYRIGHT | 8 +- modules/account_asset/MANIFEST.in | 6 - modules/account_asset/doc/conf.py | 22 +- .../account_asset/doc/requirements-doc.txt | 1 + modules/account_asset/pyproject.toml | 62 + modules/account_asset/setup.py | 134 -- modules/account_asset/tox.ini | 4 +- modules/account_be/COPYRIGHT | 6 +- modules/account_be/MANIFEST.in | 6 - modules/account_be/doc/conf.py | 22 +- modules/account_be/doc/requirements-doc.txt | 1 + modules/account_be/pyproject.toml | 63 + modules/account_be/setup.py | 116 -- modules/account_be/tox.ini | 4 +- modules/account_budget/COPYRIGHT | 6 +- modules/account_budget/MANIFEST.in | 6 - modules/account_budget/doc/conf.py | 22 +- .../account_budget/doc/requirements-doc.txt | 1 + modules/account_budget/pyproject.toml | 59 + modules/account_budget/setup.py | 134 -- modules/account_budget/tox.ini | 4 +- modules/account_cash_rounding/COPYRIGHT | 4 +- modules/account_cash_rounding/MANIFEST.in | 6 - modules/account_cash_rounding/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_cash_rounding/pyproject.toml | 59 + modules/account_cash_rounding/setup.py | 136 -- modules/account_cash_rounding/tox.ini | 4 +- modules/account_consolidation/COPYRIGHT | 4 +- modules/account_consolidation/MANIFEST.in | 6 - modules/account_consolidation/README.rst | 0 modules/account_consolidation/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_consolidation/pyproject.toml | 59 + modules/account_consolidation/setup.py | 137 -- modules/account_consolidation/tox.ini | 4 +- modules/account_credit_limit/COPYRIGHT | 4 +- modules/account_credit_limit/MANIFEST.in | 6 - modules/account_credit_limit/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_credit_limit/pyproject.toml | 59 + modules/account_credit_limit/setup.py | 133 -- modules/account_credit_limit/tox.ini | 4 +- modules/account_de_skr03/COPYRIGHT | 6 +- modules/account_de_skr03/MANIFEST.in | 6 - modules/account_de_skr03/doc/conf.py | 22 +- .../account_de_skr03/doc/requirements-doc.txt | 1 + modules/account_de_skr03/pyproject.toml | 59 + modules/account_de_skr03/setup.py | 113 -- modules/account_de_skr03/tox.ini | 4 +- modules/account_deposit/COPYRIGHT | 4 +- modules/account_deposit/MANIFEST.in | 6 - modules/account_deposit/doc/conf.py | 22 +- .../account_deposit/doc/requirements-doc.txt | 1 + modules/account_deposit/pyproject.toml | 62 + modules/account_deposit/setup.py | 136 -- modules/account_deposit/tox.ini | 4 +- modules/account_dunning/COPYRIGHT | 4 +- modules/account_dunning/MANIFEST.in | 6 - modules/account_dunning/doc/conf.py | 22 +- .../account_dunning/doc/requirements-doc.txt | 1 + modules/account_dunning/pyproject.toml | 61 + modules/account_dunning/setup.py | 132 -- modules/account_dunning/tox.ini | 4 +- modules/account_dunning_email/COPYRIGHT | 4 +- modules/account_dunning_email/MANIFEST.in | 6 - modules/account_dunning_email/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_dunning_email/pyproject.toml | 62 + modules/account_dunning_email/setup.py | 131 -- modules/account_dunning_email/tox.ini | 4 +- modules/account_dunning_fee/COPYRIGHT | 4 +- modules/account_dunning_fee/MANIFEST.in | 6 - modules/account_dunning_fee/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_dunning_fee/pyproject.toml | 59 + modules/account_dunning_fee/setup.py | 133 -- modules/account_dunning_fee/tox.ini | 4 +- modules/account_dunning_letter/COPYRIGHT | 4 +- modules/account_dunning_letter/MANIFEST.in | 6 - modules/account_dunning_letter/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_dunning_letter/pyproject.toml | 59 + modules/account_dunning_letter/setup.py | 134 -- modules/account_dunning_letter/tox.ini | 4 +- modules/account_es/COPYRIGHT | 4 +- modules/account_es/MANIFEST.in | 6 - modules/account_es/doc/conf.py | 22 +- modules/account_es/doc/requirements-doc.txt | 1 + modules/account_es/pyproject.toml | 64 + modules/account_es/setup.py | 119 -- modules/account_es/tox.ini | 4 +- modules/account_es_sii/COPYRIGHT | 6 +- modules/account_es_sii/MANIFEST.in | 6 - modules/account_es_sii/doc/conf.py | 22 +- .../account_es_sii/doc/requirements-doc.txt | 1 + modules/account_es_sii/pyproject.toml | 62 + modules/account_es_sii/setup.py | 134 -- modules/account_es_sii/tox.ini | 4 +- modules/account_eu/COPYRIGHT | 4 +- modules/account_eu/MANIFEST.in | 6 - modules/account_eu/doc/conf.py | 22 +- modules/account_eu/doc/requirements-doc.txt | 1 + modules/account_eu/pyproject.toml | 59 + modules/account_eu/setup.py | 130 -- modules/account_eu/tox.ini | 4 +- modules/account_export/COPYRIGHT | 4 +- modules/account_export/MANIFEST.in | 6 - modules/account_export/doc/conf.py | 22 +- .../account_export/doc/requirements-doc.txt | 1 + modules/account_export/pyproject.toml | 59 + modules/account_export/setup.py | 133 -- modules/account_export/tox.ini | 4 +- modules/account_export_winbooks/COPYRIGHT | 3 +- modules/account_export_winbooks/MANIFEST.in | 6 - modules/account_export_winbooks/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_export_winbooks/pyproject.toml | 62 + modules/account_export_winbooks/setup.py | 138 -- modules/account_export_winbooks/tox.ini | 4 +- modules/account_fr/COPYRIGHT | 10 +- modules/account_fr/MANIFEST.in | 6 - modules/account_fr/doc/conf.py | 22 +- modules/account_fr/doc/requirements-doc.txt | 1 + modules/account_fr/pyproject.toml | 60 + modules/account_fr/setup.py | 132 -- modules/account_fr/tox.ini | 4 +- modules/account_fr_chorus/COPYRIGHT | 3 +- modules/account_fr_chorus/MANIFEST.in | 6 - modules/account_fr_chorus/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_fr_chorus/pyproject.toml | 63 + modules/account_fr_chorus/setup.py | 136 -- modules/account_fr_chorus/tox.ini | 4 +- modules/account_fr_chorus/tryton.cfg | 1 + modules/account_invoice/COPYRIGHT | 8 +- modules/account_invoice/MANIFEST.in | 6 - modules/account_invoice/doc/conf.py | 22 +- .../account_invoice/doc/requirements-doc.txt | 1 + modules/account_invoice/pyproject.toml | 63 + modules/account_invoice/setup.py | 136 -- modules/account_invoice/tox.ini | 4 +- modules/account_invoice_correction/COPYRIGHT | 6 +- .../account_invoice_correction/MANIFEST.in | 6 - .../account_invoice_correction/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_invoice_correction/pyproject.toml | 60 + modules/account_invoice_correction/setup.py | 134 -- modules/account_invoice_correction/tox.ini | 4 +- modules/account_invoice_defer/COPYRIGHT | 3 +- modules/account_invoice_defer/MANIFEST.in | 6 - modules/account_invoice_defer/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_invoice_defer/pyproject.toml | 60 + modules/account_invoice_defer/setup.py | 133 -- modules/account_invoice_defer/tox.ini | 4 +- modules/account_invoice_history/COPYRIGHT | 6 +- modules/account_invoice_history/MANIFEST.in | 6 - modules/account_invoice_history/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_invoice_history/pyproject.toml | 60 + modules/account_invoice_history/setup.py | 133 -- modules/account_invoice_history/tox.ini | 4 +- .../account_invoice_line_standalone/COPYRIGHT | 6 +- .../MANIFEST.in | 6 - .../doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 60 + .../account_invoice_line_standalone/setup.py | 134 -- .../account_invoice_line_standalone/tox.ini | 4 +- .../account_invoice_secondary_unit/COPYRIGHT | 4 +- .../MANIFEST.in | 6 - .../doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 60 + .../account_invoice_secondary_unit/setup.py | 134 -- .../account_invoice_secondary_unit/tox.ini | 4 +- modules/account_invoice_stock/COPYRIGHT | 4 +- modules/account_invoice_stock/MANIFEST.in | 6 - modules/account_invoice_stock/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_invoice_stock/pyproject.toml | 60 + modules/account_invoice_stock/setup.py | 133 -- modules/account_invoice_stock/tox.ini | 4 +- modules/account_invoice_watermark/COPYRIGHT | 4 +- modules/account_invoice_watermark/MANIFEST.in | 6 - modules/account_invoice_watermark/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_invoice_watermark/pyproject.toml | 60 + modules/account_invoice_watermark/setup.py | 135 -- modules/account_invoice_watermark/tox.ini | 4 +- modules/account_move_line_grouping/COPYRIGHT | 3 +- .../account_move_line_grouping/MANIFEST.in | 6 - .../account_move_line_grouping/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_move_line_grouping/pyproject.toml | 60 + modules/account_move_line_grouping/setup.py | 133 -- modules/account_move_line_grouping/tox.ini | 4 +- modules/account_payment/COPYRIGHT | 4 +- modules/account_payment/MANIFEST.in | 6 - modules/account_payment/doc/conf.py | 22 +- .../account_payment/doc/requirements-doc.txt | 1 + modules/account_payment/pyproject.toml | 60 + modules/account_payment/setup.py | 140 -- modules/account_payment/tox.ini | 4 +- modules/account_payment_braintree/COPYRIGHT | 4 +- modules/account_payment_braintree/MANIFEST.in | 6 - modules/account_payment_braintree/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_payment_braintree/pyproject.toml | 61 + modules/account_payment_braintree/setup.py | 134 -- modules/account_payment_braintree/tox.ini | 4 +- modules/account_payment_clearing/COPYRIGHT | 4 +- modules/account_payment_clearing/MANIFEST.in | 6 - modules/account_payment_clearing/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_payment_clearing/pyproject.toml | 63 + modules/account_payment_clearing/setup.py | 139 -- modules/account_payment_clearing/tox.ini | 4 +- modules/account_payment_sepa/COPYRIGHT | 4 +- modules/account_payment_sepa/MANIFEST.in | 6 - modules/account_payment_sepa/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_payment_sepa/pyproject.toml | 66 + modules/account_payment_sepa/setup.py | 138 -- modules/account_payment_sepa/tox.ini | 4 +- modules/account_payment_sepa_cfonb/COPYRIGHT | 4 +- .../account_payment_sepa_cfonb/MANIFEST.in | 6 - .../account_payment_sepa_cfonb/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_payment_sepa_cfonb/pyproject.toml | 63 + modules/account_payment_sepa_cfonb/setup.py | 135 -- modules/account_payment_sepa_cfonb/tox.ini | 4 +- modules/account_payment_stripe/COPYRIGHT | 4 +- modules/account_payment_stripe/MANIFEST.in | 6 - modules/account_payment_stripe/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_payment_stripe/pyproject.toml | 61 + modules/account_payment_stripe/setup.py | 134 -- modules/account_payment_stripe/tox.ini | 4 +- modules/account_product/COPYRIGHT | 8 +- modules/account_product/MANIFEST.in | 6 - modules/account_product/doc/conf.py | 22 +- .../account_product/doc/requirements-doc.txt | 1 + modules/account_product/pyproject.toml | 60 + modules/account_product/setup.py | 132 -- modules/account_product/tox.ini | 4 +- modules/account_receivable_rule/COPYRIGHT | 4 +- modules/account_receivable_rule/MANIFEST.in | 6 - modules/account_receivable_rule/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_receivable_rule/pyproject.toml | 60 + modules/account_receivable_rule/setup.py | 137 -- modules/account_receivable_rule/tox.ini | 4 +- modules/account_rule/COPYRIGHT | 4 +- modules/account_rule/MANIFEST.in | 6 - modules/account_rule/doc/conf.py | 22 +- modules/account_rule/doc/requirements-doc.txt | 1 + modules/account_rule/pyproject.toml | 60 + modules/account_rule/setup.py | 146 -- modules/account_rule/tox.ini | 4 +- modules/account_statement/COPYRIGHT | 8 +- modules/account_statement/MANIFEST.in | 6 - modules/account_statement/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_statement/pyproject.toml | 60 + modules/account_statement/setup.py | 133 -- modules/account_statement/tox.ini | 4 +- modules/account_statement_aeb43/COPYRIGHT | 2 +- modules/account_statement_aeb43/MANIFEST.in | 6 - modules/account_statement_aeb43/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_statement_aeb43/pyproject.toml | 61 + modules/account_statement_aeb43/setup.py | 134 -- modules/account_statement_aeb43/tox.ini | 4 +- modules/account_statement_coda/COPYRIGHT | 4 +- modules/account_statement_coda/MANIFEST.in | 6 - modules/account_statement_coda/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_statement_coda/pyproject.toml | 61 + modules/account_statement_coda/setup.py | 131 -- modules/account_statement_coda/tox.ini | 4 +- modules/account_statement_mt940/COPYRIGHT | 4 +- modules/account_statement_mt940/MANIFEST.in | 6 - modules/account_statement_mt940/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_statement_mt940/pyproject.toml | 61 + modules/account_statement_mt940/setup.py | 135 -- modules/account_statement_mt940/tox.ini | 4 +- modules/account_statement_ofx/COPYRIGHT | 4 +- modules/account_statement_ofx/MANIFEST.in | 6 - modules/account_statement_ofx/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_statement_ofx/pyproject.toml | 61 + modules/account_statement_ofx/setup.py | 131 -- modules/account_statement_ofx/tox.ini | 4 +- modules/account_statement_rule/COPYRIGHT | 3 +- modules/account_statement_rule/MANIFEST.in | 6 - modules/account_statement_rule/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_statement_rule/pyproject.toml | 63 + modules/account_statement_rule/setup.py | 136 -- modules/account_statement_rule/tox.ini | 4 +- modules/account_statement_sepa/COPYRIGHT | 6 +- modules/account_statement_sepa/MANIFEST.in | 6 - modules/account_statement_sepa/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_statement_sepa/pyproject.toml | 61 + modules/account_statement_sepa/setup.py | 133 -- modules/account_statement_sepa/tox.ini | 4 +- modules/account_stock_anglo_saxon/COPYRIGHT | 4 +- modules/account_stock_anglo_saxon/MANIFEST.in | 6 - modules/account_stock_anglo_saxon/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_stock_anglo_saxon/pyproject.toml | 65 + modules/account_stock_anglo_saxon/setup.py | 137 -- modules/account_stock_anglo_saxon/tox.ini | 4 +- modules/account_stock_continental/COPYRIGHT | 4 +- modules/account_stock_continental/MANIFEST.in | 6 - modules/account_stock_continental/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_stock_continental/pyproject.toml | 66 + modules/account_stock_continental/setup.py | 137 -- modules/account_stock_continental/tox.ini | 4 +- modules/account_stock_eu/COPYRIGHT | 4 +- modules/account_stock_eu/MANIFEST.in | 6 - modules/account_stock_eu/doc/conf.py | 22 +- .../account_stock_eu/doc/requirements-doc.txt | 1 + modules/account_stock_eu/pyproject.toml | 65 + modules/account_stock_eu/setup.py | 140 -- modules/account_stock_eu/tox.ini | 4 +- modules/account_stock_landed_cost/COPYRIGHT | 4 +- modules/account_stock_landed_cost/MANIFEST.in | 6 - modules/account_stock_landed_cost/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_stock_landed_cost/pyproject.toml | 60 + modules/account_stock_landed_cost/setup.py | 134 -- modules/account_stock_landed_cost/tox.ini | 4 +- .../COPYRIGHT | 4 +- .../MANIFEST.in | 6 - .../doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 60 + .../account_stock_landed_cost_weight/setup.py | 135 -- .../account_stock_landed_cost_weight/tox.ini | 4 +- modules/account_stock_shipment_cost/COPYRIGHT | 4 +- .../account_stock_shipment_cost/MANIFEST.in | 6 - .../account_stock_shipment_cost/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 60 + modules/account_stock_shipment_cost/setup.py | 135 -- modules/account_stock_shipment_cost/tox.ini | 4 +- .../COPYRIGHT | 4 +- .../MANIFEST.in | 6 - .../doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 60 + .../setup.py | 135 -- .../tox.ini | 4 +- modules/account_syscohada/COPYRIGHT | 4 +- modules/account_syscohada/MANIFEST.in | 6 - modules/account_syscohada/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/account_syscohada/pyproject.toml | 60 + modules/account_syscohada/setup.py | 131 -- modules/account_syscohada/tox.ini | 4 +- modules/account_tax_cash/COPYRIGHT | 4 +- modules/account_tax_cash/MANIFEST.in | 6 - modules/account_tax_cash/doc/conf.py | 22 +- .../account_tax_cash/doc/requirements-doc.txt | 1 + modules/account_tax_cash/pyproject.toml | 60 + modules/account_tax_cash/setup.py | 130 -- modules/account_tax_cash/tox.ini | 4 +- modules/account_tax_non_deductible/COPYRIGHT | 4 +- .../account_tax_non_deductible/MANIFEST.in | 6 - .../account_tax_non_deductible/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_tax_non_deductible/pyproject.toml | 60 + modules/account_tax_non_deductible/setup.py | 135 -- modules/account_tax_non_deductible/tox.ini | 4 +- modules/account_tax_rule_country/COPYRIGHT | 4 +- modules/account_tax_rule_country/MANIFEST.in | 6 - modules/account_tax_rule_country/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../account_tax_rule_country/pyproject.toml | 60 + modules/account_tax_rule_country/setup.py | 135 -- modules/account_tax_rule_country/tox.ini | 4 +- modules/analytic_account/COPYRIGHT | 8 +- modules/analytic_account/MANIFEST.in | 6 - modules/analytic_account/doc/conf.py | 22 +- .../analytic_account/doc/requirements-doc.txt | 1 + modules/analytic_account/pyproject.toml | 60 + modules/analytic_account/setup.py | 132 -- modules/analytic_account/tox.ini | 4 +- modules/analytic_budget/COPYRIGHT | 6 +- modules/analytic_budget/MANIFEST.in | 6 - modules/analytic_budget/doc/conf.py | 22 +- .../analytic_budget/doc/requirements-doc.txt | 1 + modules/analytic_budget/pyproject.toml | 60 + modules/analytic_budget/setup.py | 135 -- modules/analytic_budget/tox.ini | 4 +- modules/analytic_invoice/COPYRIGHT | 6 +- modules/analytic_invoice/MANIFEST.in | 6 - modules/analytic_invoice/doc/conf.py | 22 +- .../analytic_invoice/doc/requirements-doc.txt | 1 + modules/analytic_invoice/pyproject.toml | 60 + modules/analytic_invoice/setup.py | 134 -- modules/analytic_invoice/tox.ini | 4 +- modules/analytic_purchase/COPYRIGHT | 6 +- modules/analytic_purchase/MANIFEST.in | 6 - modules/analytic_purchase/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/analytic_purchase/pyproject.toml | 60 + modules/analytic_purchase/setup.py | 132 -- modules/analytic_purchase/tox.ini | 4 +- modules/analytic_sale/COPYRIGHT | 6 +- modules/analytic_sale/MANIFEST.in | 6 - modules/analytic_sale/doc/conf.py | 22 +- .../analytic_sale/doc/requirements-doc.txt | 1 + modules/analytic_sale/pyproject.toml | 60 + modules/analytic_sale/setup.py | 132 -- modules/analytic_sale/tox.ini | 4 +- modules/attendance/COPYRIGHT | 6 +- modules/attendance/MANIFEST.in | 6 - modules/attendance/README.rst | 0 modules/attendance/doc/conf.py | 22 +- modules/attendance/doc/requirements-doc.txt | 1 + modules/attendance/pyproject.toml | 59 + modules/attendance/setup.py | 133 -- modules/attendance/tox.ini | 4 +- modules/authentication_saml/COPYRIGHT | 4 +- modules/authentication_saml/MANIFEST.in | 6 - modules/authentication_saml/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/authentication_saml/pyproject.toml | 59 + modules/authentication_saml/setup.py | 133 -- modules/authentication_saml/tox.ini | 4 +- modules/authentication_sms/COPYRIGHT | 4 +- modules/authentication_sms/MANIFEST.in | 6 - modules/authentication_sms/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/authentication_sms/pyproject.toml | 59 + modules/authentication_sms/setup.py | 132 -- modules/authentication_sms/tox.ini | 4 +- modules/bank/COPYRIGHT | 4 +- modules/bank/MANIFEST.in | 6 - modules/bank/doc/conf.py | 22 +- modules/bank/doc/requirements-doc.txt | 1 + modules/bank/pyproject.toml | 66 + modules/bank/setup.py | 132 -- modules/bank/tox.ini | 4 +- modules/carrier/COPYRIGHT | 8 +- modules/carrier/MANIFEST.in | 6 - modules/carrier/doc/conf.py | 22 +- modules/carrier/doc/requirements-doc.txt | 1 + modules/carrier/pyproject.toml | 59 + modules/carrier/setup.py | 131 -- modules/carrier/tox.ini | 4 +- modules/carrier_carriage/COPYRIGHT | 4 +- modules/carrier_carriage/MANIFEST.in | 6 - modules/carrier_carriage/doc/conf.py | 22 +- .../carrier_carriage/doc/requirements-doc.txt | 1 + modules/carrier_carriage/pyproject.toml | 59 + modules/carrier_carriage/setup.py | 139 -- modules/carrier_carriage/tox.ini | 4 +- modules/carrier_percentage/COPYRIGHT | 8 +- modules/carrier_percentage/MANIFEST.in | 6 - modules/carrier_percentage/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/carrier_percentage/pyproject.toml | 59 + modules/carrier_percentage/setup.py | 137 -- modules/carrier_percentage/tox.ini | 4 +- modules/carrier_subdivision/COPYRIGHT | 2 +- modules/carrier_subdivision/MANIFEST.in | 6 - modules/carrier_subdivision/README.rst | 0 modules/carrier_subdivision/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/carrier_subdivision/pyproject.toml | 59 + modules/carrier_subdivision/setup.py | 138 -- modules/carrier_subdivision/tox.ini | 4 +- modules/carrier_weight/COPYRIGHT | 8 +- modules/carrier_weight/MANIFEST.in | 6 - modules/carrier_weight/doc/conf.py | 22 +- .../carrier_weight/doc/requirements-doc.txt | 1 + modules/carrier_weight/pyproject.toml | 59 + modules/carrier_weight/setup.py | 136 -- modules/carrier_weight/tox.ini | 4 +- modules/commission/COPYRIGHT | 4 +- modules/commission/MANIFEST.in | 6 - modules/commission/doc/conf.py | 22 +- modules/commission/doc/requirements-doc.txt | 1 + modules/commission/pyproject.toml | 63 + modules/commission/setup.py | 137 -- modules/commission/tox.ini | 4 +- modules/commission_waiting/COPYRIGHT | 4 +- modules/commission_waiting/MANIFEST.in | 6 - modules/commission_waiting/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/commission_waiting/pyproject.toml | 59 + modules/commission_waiting/setup.py | 133 -- modules/commission_waiting/tox.ini | 4 +- modules/company/COPYRIGHT | 6 +- modules/company/MANIFEST.in | 6 - modules/company/doc/conf.py | 22 +- modules/company/doc/requirements-doc.txt | 1 + modules/company/pyproject.toml | 59 + modules/company/setup.py | 133 -- modules/company/tox.ini | 4 +- modules/company_work_time/COPYRIGHT | 6 +- modules/company_work_time/MANIFEST.in | 6 - modules/company_work_time/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/company_work_time/pyproject.toml | 59 + modules/company_work_time/setup.py | 132 -- modules/company_work_time/tox.ini | 4 +- modules/country/COPYRIGHT | 8 +- modules/country/MANIFEST.in | 6 - modules/country/doc/conf.py | 22 +- modules/country/doc/requirements-doc.txt | 1 + modules/country/pyproject.toml | 70 + modules/country/setup.py | 138 -- modules/country/tox.ini | 4 +- modules/currency/COPYRIGHT | 6 +- modules/currency/MANIFEST.in | 6 - modules/currency/doc/conf.py | 22 +- modules/currency/doc/requirements-doc.txt | 1 + modules/currency/pyproject.toml | 71 + modules/currency/setup.py | 137 -- modules/currency/tox.ini | 4 +- modules/currency_ro/COPYRIGHT | 4 +- modules/currency_ro/MANIFEST.in | 6 - modules/currency_ro/doc/conf.py | 22 +- modules/currency_ro/doc/requirements-doc.txt | 1 + modules/currency_ro/pyproject.toml | 62 + modules/currency_ro/setup.py | 133 -- modules/currency_ro/tox.ini | 4 +- modules/currency_rs/COPYRIGHT | 4 +- modules/currency_rs/MANIFEST.in | 6 - modules/currency_rs/doc/conf.py | 22 +- modules/currency_rs/doc/requirements-doc.txt | 1 + modules/currency_rs/pyproject.toml | 62 + modules/currency_rs/setup.py | 133 -- modules/currency_rs/tox.ini | 4 +- modules/customs/COPYRIGHT | 4 +- modules/customs/MANIFEST.in | 6 - modules/customs/doc/conf.py | 22 +- modules/customs/doc/requirements-doc.txt | 1 + modules/customs/pyproject.toml | 62 + modules/customs/setup.py | 132 -- modules/customs/tox.ini | 4 +- modules/dashboard/COPYRIGHT | 6 +- modules/dashboard/MANIFEST.in | 6 - modules/dashboard/doc/conf.py | 22 +- modules/dashboard/doc/requirements-doc.txt | 1 + modules/dashboard/pyproject.toml | 62 + modules/dashboard/setup.py | 129 -- modules/dashboard/tox.ini | 4 +- modules/document_incoming/COPYRIGHT | 4 +- modules/document_incoming/MANIFEST.in | 6 - modules/document_incoming/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/document_incoming/pyproject.toml | 60 + modules/document_incoming/setup.py | 136 -- modules/document_incoming/tox.ini | 4 +- modules/document_incoming_invoice/COPYRIGHT | 4 +- modules/document_incoming_invoice/MANIFEST.in | 6 - modules/document_incoming_invoice/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../document_incoming_invoice/pyproject.toml | 59 + modules/document_incoming_invoice/setup.py | 134 -- modules/document_incoming_invoice/tox.ini | 4 +- modules/document_incoming_ocr/COPYRIGHT | 4 +- modules/document_incoming_ocr/MANIFEST.in | 6 - modules/document_incoming_ocr/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/document_incoming_ocr/pyproject.toml | 59 + modules/document_incoming_ocr/setup.py | 133 -- modules/document_incoming_ocr/tox.ini | 4 +- .../document_incoming_ocr_typless/COPYRIGHT | 4 +- .../document_incoming_ocr_typless/MANIFEST.in | 6 - .../document_incoming_ocr_typless/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 60 + .../document_incoming_ocr_typless/setup.py | 138 -- modules/document_incoming_ocr_typless/tox.ini | 4 +- modules/edocument_peppol/COPYRIGHT | 3 +- modules/edocument_peppol/MANIFEST.in | 6 - modules/edocument_peppol/doc/conf.py | 22 +- .../edocument_peppol/doc/requirements-doc.txt | 1 + modules/edocument_peppol/pyproject.toml | 59 + modules/edocument_peppol/setup.py | 133 -- modules/edocument_peppol/tox.ini | 4 +- modules/edocument_peppol_peppyrus/COPYRIGHT | 3 +- modules/edocument_peppol_peppyrus/MANIFEST.in | 6 - modules/edocument_peppol_peppyrus/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../edocument_peppol_peppyrus/pyproject.toml | 63 + modules/edocument_peppol_peppyrus/setup.py | 134 -- modules/edocument_peppol_peppyrus/tox.ini | 4 +- modules/edocument_ubl/COPYRIGHT | 3 +- modules/edocument_ubl/MANIFEST.in | 6 - modules/edocument_ubl/doc/conf.py | 22 +- .../edocument_ubl/doc/requirements-doc.txt | 1 + modules/edocument_ubl/pyproject.toml | 66 + modules/edocument_ubl/setup.py | 142 -- modules/edocument_ubl/tox.ini | 4 +- modules/edocument_uncefact/COPYRIGHT | 4 +- modules/edocument_uncefact/MANIFEST.in | 6 - modules/edocument_uncefact/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/edocument_uncefact/pyproject.toml | 63 + modules/edocument_uncefact/setup.py | 137 -- modules/edocument_uncefact/tox.ini | 4 +- modules/edocument_unece/COPYRIGHT | 4 +- modules/edocument_unece/MANIFEST.in | 6 - modules/edocument_unece/doc/conf.py | 22 +- .../edocument_unece/doc/requirements-doc.txt | 1 + modules/edocument_unece/pyproject.toml | 59 + modules/edocument_unece/setup.py | 132 -- modules/edocument_unece/tox.ini | 4 +- modules/google_maps/COPYRIGHT | 6 +- modules/google_maps/MANIFEST.in | 6 - modules/google_maps/doc/conf.py | 22 +- modules/google_maps/doc/requirements-doc.txt | 1 + modules/google_maps/pyproject.toml | 59 + modules/google_maps/setup.py | 131 -- modules/google_maps/tox.ini | 4 +- modules/inbound_email/COPYRIGHT | 4 +- modules/inbound_email/MANIFEST.in | 6 - modules/inbound_email/doc/conf.py | 22 +- .../inbound_email/doc/requirements-doc.txt | 1 + modules/inbound_email/pyproject.toml | 59 + modules/inbound_email/setup.py | 133 -- modules/inbound_email/tox.ini | 4 +- modules/incoterm/COPYRIGHT | 3 +- modules/incoterm/MANIFEST.in | 6 - modules/incoterm/doc/conf.py | 22 +- modules/incoterm/doc/requirements-doc.txt | 1 + modules/incoterm/pyproject.toml | 59 + modules/incoterm/setup.py | 146 -- modules/incoterm/tox.ini | 4 +- modules/ldap_authentication/COPYRIGHT | 10 +- modules/ldap_authentication/MANIFEST.in | 6 - modules/ldap_authentication/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/ldap_authentication/pyproject.toml | 59 + modules/ldap_authentication/setup.py | 133 -- modules/ldap_authentication/tox.ini | 4 +- modules/marketing/COPYRIGHT | 4 +- modules/marketing/MANIFEST.in | 6 - modules/marketing/doc/conf.py | 22 +- modules/marketing/doc/requirements-doc.txt | 1 + modules/marketing/pyproject.toml | 59 + modules/marketing/setup.py | 131 -- modules/marketing/tox.ini | 4 +- modules/marketing_automation/COPYRIGHT | 6 +- modules/marketing_automation/MANIFEST.in | 6 - modules/marketing_automation/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/marketing_automation/pyproject.toml | 65 + modules/marketing_automation/setup.py | 138 -- modules/marketing_automation/tox.ini | 4 +- modules/marketing_campaign/COPYRIGHT | 4 +- modules/marketing_campaign/MANIFEST.in | 6 - modules/marketing_campaign/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/marketing_campaign/pyproject.toml | 59 + modules/marketing_campaign/setup.py | 141 -- modules/marketing_campaign/tox.ini | 4 +- modules/marketing_email/COPYRIGHT | 6 +- modules/marketing_email/MANIFEST.in | 6 - modules/marketing_email/doc/conf.py | 22 +- .../marketing_email/doc/requirements-doc.txt | 1 + modules/marketing_email/pyproject.toml | 61 + modules/marketing_email/setup.py | 131 -- modules/marketing_email/tox.ini | 4 +- modules/notification_email/COPYRIGHT | 6 +- modules/notification_email/MANIFEST.in | 6 - modules/notification_email/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/notification_email/pyproject.toml | 62 + modules/notification_email/setup.py | 135 -- modules/notification_email/tox.ini | 4 +- modules/party/COPYRIGHT | 14 +- modules/party/MANIFEST.in | 6 - modules/party/doc/conf.py | 22 +- modules/party/doc/requirements-doc.txt | 1 + modules/party/pyproject.toml | 68 + modules/party/setup.py | 135 -- modules/party/tox.ini | 4 +- modules/party_avatar/COPYRIGHT | 3 +- modules/party_avatar/MANIFEST.in | 6 - modules/party_avatar/doc/conf.py | 22 +- modules/party_avatar/doc/requirements-doc.txt | 1 + modules/party_avatar/pyproject.toml | 59 + modules/party_avatar/setup.py | 133 -- modules/party_avatar/tox.ini | 4 +- modules/party_relationship/COPYRIGHT | 6 +- modules/party_relationship/MANIFEST.in | 6 - modules/party_relationship/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/party_relationship/pyproject.toml | 59 + modules/party_relationship/setup.py | 132 -- modules/party_relationship/tox.ini | 4 +- modules/party_siret/COPYRIGHT | 6 +- modules/party_siret/MANIFEST.in | 6 - modules/party_siret/doc/conf.py | 22 +- modules/party_siret/doc/requirements-doc.txt | 1 + modules/party_siret/pyproject.toml | 59 + modules/party_siret/setup.py | 131 -- modules/party_siret/tox.ini | 4 +- modules/product/COPYRIGHT | 8 +- modules/product/MANIFEST.in | 6 - modules/product/doc/conf.py | 22 +- modules/product/doc/requirements-doc.txt | 1 + modules/product/pyproject.toml | 65 + modules/product/setup.py | 135 -- modules/product/tox.ini | 4 +- modules/product_attribute/COPYRIGHT | 4 +- modules/product_attribute/MANIFEST.in | 6 - modules/product_attribute/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/product_attribute/pyproject.toml | 59 + modules/product_attribute/setup.py | 135 -- modules/product_attribute/tox.ini | 4 +- modules/product_classification/COPYRIGHT | 4 +- modules/product_classification/MANIFEST.in | 6 - modules/product_classification/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/product_classification/pyproject.toml | 59 + modules/product_classification/setup.py | 130 -- modules/product_classification/tox.ini | 4 +- .../COPYRIGHT | 4 +- .../MANIFEST.in | 6 - .../doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 59 + .../product_classification_taxonomic/setup.py | 127 -- .../product_classification_taxonomic/tox.ini | 4 +- modules/product_cost_fifo/COPYRIGHT | 6 +- modules/product_cost_fifo/MANIFEST.in | 6 - modules/product_cost_fifo/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/product_cost_fifo/pyproject.toml | 59 + modules/product_cost_fifo/setup.py | 129 -- modules/product_cost_fifo/tox.ini | 4 +- modules/product_cost_history/COPYRIGHT | 6 +- modules/product_cost_history/MANIFEST.in | 6 - modules/product_cost_history/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/product_cost_history/pyproject.toml | 59 + modules/product_cost_history/setup.py | 129 -- modules/product_cost_history/tox.ini | 4 +- modules/product_cost_warehouse/COPYRIGHT | 4 +- modules/product_cost_warehouse/MANIFEST.in | 6 - modules/product_cost_warehouse/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/product_cost_warehouse/pyproject.toml | 59 + modules/product_cost_warehouse/setup.py | 139 -- modules/product_cost_warehouse/tox.ini | 4 +- modules/product_image/COPYRIGHT | 3 +- modules/product_image/MANIFEST.in | 6 - modules/product_image/doc/conf.py | 22 +- .../product_image/doc/requirements-doc.txt | 1 + modules/product_image/pyproject.toml | 59 + modules/product_image/setup.py | 133 -- modules/product_image/tox.ini | 4 +- modules/product_image_attribute/COPYRIGHT | 4 +- modules/product_image_attribute/MANIFEST.in | 6 - modules/product_image_attribute/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../product_image_attribute/pyproject.toml | 59 + modules/product_image_attribute/setup.py | 134 -- modules/product_image_attribute/tox.ini | 4 +- modules/product_kit/COPYRIGHT | 6 +- modules/product_kit/MANIFEST.in | 6 - modules/product_kit/doc/conf.py | 22 +- modules/product_kit/doc/requirements-doc.txt | 1 + modules/product_kit/pyproject.toml | 59 + modules/product_kit/setup.py | 143 -- modules/product_kit/tox.ini | 4 +- modules/product_measurements/COPYRIGHT | 8 +- modules/product_measurements/MANIFEST.in | 6 - modules/product_measurements/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/product_measurements/pyproject.toml | 59 + modules/product_measurements/setup.py | 131 -- modules/product_measurements/tox.ini | 4 +- modules/product_price_list/COPYRIGHT | 6 +- modules/product_price_list/MANIFEST.in | 6 - modules/product_price_list/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/product_price_list/pyproject.toml | 62 + modules/product_price_list/setup.py | 128 -- modules/product_price_list/tox.ini | 4 +- modules/product_price_list_cache/COPYRIGHT | 4 +- modules/product_price_list_cache/MANIFEST.in | 6 - modules/product_price_list_cache/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../product_price_list_cache/pyproject.toml | 59 + modules/product_price_list_cache/setup.py | 134 -- modules/product_price_list_cache/tox.ini | 4 +- modules/product_price_list_dates/COPYRIGHT | 4 +- modules/product_price_list_dates/MANIFEST.in | 6 - modules/product_price_list_dates/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../product_price_list_dates/pyproject.toml | 59 + modules/product_price_list_dates/setup.py | 136 -- modules/product_price_list_dates/tox.ini | 4 +- modules/product_price_list_parent/COPYRIGHT | 4 +- modules/product_price_list_parent/MANIFEST.in | 6 - modules/product_price_list_parent/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../product_price_list_parent/pyproject.toml | 59 + modules/product_price_list_parent/setup.py | 129 -- modules/product_price_list_parent/tox.ini | 4 +- modules/production/COPYRIGHT | 4 +- modules/production/MANIFEST.in | 6 - modules/production/doc/conf.py | 22 +- modules/production/doc/requirements-doc.txt | 1 + modules/production/pyproject.toml | 59 + modules/production/setup.py | 135 -- modules/production/tox.ini | 4 +- modules/production_outsourcing/COPYRIGHT | 4 +- modules/production_outsourcing/MANIFEST.in | 6 - modules/production_outsourcing/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/production_outsourcing/pyproject.toml | 59 + modules/production_outsourcing/setup.py | 129 -- modules/production_outsourcing/tox.ini | 4 +- modules/production_routing/COPYRIGHT | 6 +- modules/production_routing/MANIFEST.in | 6 - modules/production_routing/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/production_routing/pyproject.toml | 59 + modules/production_routing/setup.py | 132 -- modules/production_routing/tox.ini | 4 +- modules/production_split/COPYRIGHT | 6 +- modules/production_split/MANIFEST.in | 6 - modules/production_split/doc/conf.py | 22 +- .../production_split/doc/requirements-doc.txt | 1 + modules/production_split/pyproject.toml | 59 + modules/production_split/setup.py | 130 -- modules/production_split/tox.ini | 4 +- modules/production_work/COPYRIGHT | 6 +- modules/production_work/MANIFEST.in | 6 - modules/production_work/doc/conf.py | 22 +- .../production_work/doc/requirements-doc.txt | 1 + modules/production_work/pyproject.toml | 59 + modules/production_work/setup.py | 128 -- modules/production_work/tox.ini | 4 +- modules/production_work_timesheet/COPYRIGHT | 4 +- modules/production_work_timesheet/MANIFEST.in | 6 - modules/production_work_timesheet/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../production_work_timesheet/pyproject.toml | 59 + modules/production_work_timesheet/setup.py | 128 -- modules/production_work_timesheet/tox.ini | 4 +- modules/project/COPYRIGHT | 6 +- modules/project/MANIFEST.in | 6 - modules/project/doc/conf.py | 22 +- modules/project/doc/requirements-doc.txt | 1 + modules/project/pyproject.toml | 59 + modules/project/setup.py | 132 -- modules/project/tox.ini | 4 +- modules/project_invoice/COPYRIGHT | 4 +- modules/project_invoice/MANIFEST.in | 6 - modules/project_invoice/doc/conf.py | 22 +- .../project_invoice/doc/requirements-doc.txt | 1 + modules/project_invoice/pyproject.toml | 59 + modules/project_invoice/setup.py | 128 -- modules/project_invoice/tox.ini | 4 +- modules/project_plan/COPYRIGHT | 6 +- modules/project_plan/MANIFEST.in | 6 - modules/project_plan/doc/conf.py | 22 +- modules/project_plan/doc/requirements-doc.txt | 1 + modules/project_plan/pyproject.toml | 59 + modules/project_plan/setup.py | 128 -- modules/project_plan/tox.ini | 4 +- modules/project_revenue/COPYRIGHT | 4 +- modules/project_revenue/MANIFEST.in | 6 - modules/project_revenue/doc/conf.py | 22 +- .../project_revenue/doc/requirements-doc.txt | 1 + modules/project_revenue/pyproject.toml | 59 + modules/project_revenue/setup.py | 129 -- modules/project_revenue/tox.ini | 4 +- modules/purchase/COPYRIGHT | 8 +- modules/purchase/MANIFEST.in | 6 - modules/purchase/doc/conf.py | 22 +- modules/purchase/doc/requirements-doc.txt | 1 + modules/purchase/pyproject.toml | 59 + modules/purchase/setup.py | 132 -- modules/purchase/tox.ini | 4 +- modules/purchase_amendment/COPYRIGHT | 4 +- modules/purchase_amendment/MANIFEST.in | 6 - modules/purchase_amendment/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/purchase_amendment/pyproject.toml | 59 + modules/purchase_amendment/setup.py | 129 -- modules/purchase_amendment/tox.ini | 4 +- modules/purchase_blanket_agreement/COPYRIGHT | 4 +- .../purchase_blanket_agreement/MANIFEST.in | 6 - modules/purchase_blanket_agreement/README.rst | 0 .../purchase_blanket_agreement/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../purchase_blanket_agreement/pyproject.toml | 59 + modules/purchase_blanket_agreement/setup.py | 137 -- modules/purchase_blanket_agreement/tox.ini | 4 +- modules/purchase_history/COPYRIGHT | 4 +- modules/purchase_history/MANIFEST.in | 6 - modules/purchase_history/doc/conf.py | 22 +- .../purchase_history/doc/requirements-doc.txt | 1 + modules/purchase_history/pyproject.toml | 59 + modules/purchase_history/setup.py | 127 -- modules/purchase_history/tox.ini | 4 +- .../COPYRIGHT | 6 +- .../MANIFEST.in | 6 - .../doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 59 + .../purchase_invoice_line_standalone/setup.py | 133 -- .../purchase_invoice_line_standalone/tox.ini | 4 +- modules/purchase_price_list/COPYRIGHT | 3 +- modules/purchase_price_list/MANIFEST.in | 6 - modules/purchase_price_list/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/purchase_price_list/pyproject.toml | 59 + modules/purchase_price_list/setup.py | 133 -- modules/purchase_price_list/tox.ini | 4 +- modules/purchase_product_quantity/COPYRIGHT | 4 +- modules/purchase_product_quantity/MANIFEST.in | 6 - modules/purchase_product_quantity/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../purchase_product_quantity/pyproject.toml | 59 + modules/purchase_product_quantity/setup.py | 137 -- modules/purchase_product_quantity/tox.ini | 4 +- modules/purchase_request/COPYRIGHT | 10 +- modules/purchase_request/MANIFEST.in | 6 - modules/purchase_request/doc/conf.py | 22 +- .../purchase_request/doc/requirements-doc.txt | 1 + modules/purchase_request/pyproject.toml | 62 + modules/purchase_request/setup.py | 132 -- modules/purchase_request/tox.ini | 4 +- modules/purchase_request_quotation/COPYRIGHT | 4 +- .../purchase_request_quotation/MANIFEST.in | 6 - .../purchase_request_quotation/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../purchase_request_quotation/pyproject.toml | 59 + modules/purchase_request_quotation/setup.py | 136 -- modules/purchase_request_quotation/tox.ini | 4 +- modules/purchase_requisition/MANIFEST.in | 6 - modules/purchase_requisition/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/purchase_requisition/pyproject.toml | 59 + modules/purchase_requisition/setup.py | 129 -- modules/purchase_requisition/tox.ini | 4 +- modules/purchase_secondary_unit/COPYRIGHT | 4 +- modules/purchase_secondary_unit/MANIFEST.in | 6 - modules/purchase_secondary_unit/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../purchase_secondary_unit/pyproject.toml | 59 + modules/purchase_secondary_unit/setup.py | 134 -- modules/purchase_secondary_unit/tox.ini | 4 +- modules/purchase_shipment_cost/COPYRIGHT | 8 +- modules/purchase_shipment_cost/MANIFEST.in | 6 - modules/purchase_shipment_cost/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/purchase_shipment_cost/pyproject.toml | 62 + modules/purchase_shipment_cost/setup.py | 133 -- modules/purchase_shipment_cost/tox.ini | 4 +- modules/quality/COPYRIGHT | 6 +- modules/quality/MANIFEST.in | 6 - modules/quality/doc/conf.py | 22 +- modules/quality/doc/requirements-doc.txt | 1 + modules/quality/pyproject.toml | 59 + modules/quality/setup.py | 136 -- modules/quality/tox.ini | 4 +- modules/sale/COPYRIGHT | 8 +- modules/sale/MANIFEST.in | 6 - modules/sale/doc/conf.py | 22 +- modules/sale/doc/requirements-doc.txt | 1 + modules/sale/pyproject.toml | 63 + modules/sale/setup.py | 132 -- modules/sale/tox.ini | 4 +- modules/sale_advance_payment/COPYRIGHT | 6 +- modules/sale_advance_payment/MANIFEST.in | 6 - modules/sale_advance_payment/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_advance_payment/pyproject.toml | 60 + modules/sale_advance_payment/setup.py | 136 -- modules/sale_advance_payment/tox.ini | 4 +- modules/sale_amendment/COPYRIGHT | 4 +- modules/sale_amendment/MANIFEST.in | 6 - modules/sale_amendment/doc/conf.py | 22 +- .../sale_amendment/doc/requirements-doc.txt | 1 + modules/sale_amendment/pyproject.toml | 60 + modules/sale_amendment/setup.py | 128 -- modules/sale_amendment/tox.ini | 4 +- modules/sale_blanket_agreement/COPYRIGHT | 4 +- modules/sale_blanket_agreement/MANIFEST.in | 6 - modules/sale_blanket_agreement/README.rst | 0 modules/sale_blanket_agreement/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_blanket_agreement/pyproject.toml | 60 + modules/sale_blanket_agreement/setup.py | 136 -- modules/sale_blanket_agreement/tox.ini | 4 +- modules/sale_complaint/COPYRIGHT | 4 +- modules/sale_complaint/MANIFEST.in | 6 - modules/sale_complaint/doc/conf.py | 22 +- .../sale_complaint/doc/requirements-doc.txt | 1 + modules/sale_complaint/pyproject.toml | 60 + modules/sale_complaint/setup.py | 132 -- modules/sale_complaint/tox.ini | 4 +- modules/sale_credit_limit/COPYRIGHT | 4 +- modules/sale_credit_limit/MANIFEST.in | 6 - modules/sale_credit_limit/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_credit_limit/pyproject.toml | 60 + modules/sale_credit_limit/setup.py | 128 -- modules/sale_credit_limit/tox.ini | 4 +- modules/sale_discount/COPYRIGHT | 4 +- modules/sale_discount/MANIFEST.in | 6 - modules/sale_discount/doc/conf.py | 22 +- .../sale_discount/doc/requirements-doc.txt | 1 + modules/sale_discount/pyproject.toml | 60 + modules/sale_discount/setup.py | 132 -- modules/sale_discount/tox.ini | 4 +- modules/sale_extra/COPYRIGHT | 4 +- modules/sale_extra/MANIFEST.in | 6 - modules/sale_extra/doc/conf.py | 22 +- modules/sale_extra/doc/requirements-doc.txt | 1 + modules/sale_extra/pyproject.toml | 60 + modules/sale_extra/setup.py | 128 -- modules/sale_extra/tox.ini | 4 +- modules/sale_gift_card/COPYRIGHT | 4 +- modules/sale_gift_card/MANIFEST.in | 6 - modules/sale_gift_card/doc/conf.py | 22 +- .../sale_gift_card/doc/requirements-doc.txt | 1 + modules/sale_gift_card/pyproject.toml | 61 + modules/sale_gift_card/setup.py | 135 -- modules/sale_gift_card/tox.ini | 4 +- modules/sale_history/COPYRIGHT | 4 +- modules/sale_history/MANIFEST.in | 6 - modules/sale_history/doc/conf.py | 22 +- modules/sale_history/doc/requirements-doc.txt | 1 + modules/sale_history/pyproject.toml | 60 + modules/sale_history/setup.py | 130 -- modules/sale_history/tox.ini | 4 +- modules/sale_invoice_date/COPYRIGHT | 3 +- modules/sale_invoice_date/MANIFEST.in | 6 - modules/sale_invoice_date/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_invoice_date/pyproject.toml | 60 + modules/sale_invoice_date/setup.py | 136 -- modules/sale_invoice_date/tox.ini | 4 +- modules/sale_invoice_grouping/COPYRIGHT | 4 +- modules/sale_invoice_grouping/MANIFEST.in | 6 - modules/sale_invoice_grouping/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_invoice_grouping/pyproject.toml | 60 + modules/sale_invoice_grouping/setup.py | 129 -- modules/sale_invoice_grouping/tox.ini | 4 +- modules/sale_opportunity/COPYRIGHT | 6 +- modules/sale_opportunity/MANIFEST.in | 6 - modules/sale_opportunity/doc/conf.py | 22 +- .../sale_opportunity/doc/requirements-doc.txt | 1 + modules/sale_opportunity/pyproject.toml | 63 + modules/sale_opportunity/setup.py | 133 -- modules/sale_opportunity/tox.ini | 4 +- modules/sale_payment/COPYRIGHT | 6 +- modules/sale_payment/MANIFEST.in | 6 - modules/sale_payment/doc/conf.py | 22 +- modules/sale_payment/doc/requirements-doc.txt | 1 + modules/sale_payment/pyproject.toml | 60 + modules/sale_payment/setup.py | 130 -- modules/sale_payment/tox.ini | 4 +- modules/sale_point/COPYRIGHT | 4 +- modules/sale_point/MANIFEST.in | 6 - modules/sale_point/doc/conf.py | 22 +- modules/sale_point/doc/requirements-doc.txt | 1 + modules/sale_point/pyproject.toml | 60 + modules/sale_point/setup.py | 134 -- modules/sale_point/tox.ini | 4 +- modules/sale_price_list/COPYRIGHT | 6 +- modules/sale_price_list/MANIFEST.in | 6 - modules/sale_price_list/doc/conf.py | 22 +- .../sale_price_list/doc/requirements-doc.txt | 1 + modules/sale_price_list/pyproject.toml | 60 + modules/sale_price_list/setup.py | 127 -- modules/sale_price_list/tox.ini | 4 +- modules/sale_product_customer/MANIFEST.in | 6 - modules/sale_product_customer/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_product_customer/pyproject.toml | 60 + modules/sale_product_customer/setup.py | 133 -- modules/sale_product_customer/tox.ini | 4 +- modules/sale_product_quantity/COPYRIGHT | 4 +- modules/sale_product_quantity/MANIFEST.in | 6 - modules/sale_product_quantity/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_product_quantity/pyproject.toml | 60 + modules/sale_product_quantity/setup.py | 136 -- modules/sale_product_quantity/tox.ini | 4 +- modules/sale_product_recommendation/COPYRIGHT | 4 +- .../sale_product_recommendation/MANIFEST.in | 6 - .../sale_product_recommendation/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 60 + modules/sale_product_recommendation/setup.py | 134 -- modules/sale_product_recommendation/tox.ini | 4 +- .../COPYRIGHT | 4 +- .../MANIFEST.in | 6 - .../doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 60 + .../setup.py | 141 -- .../tox.ini | 4 +- modules/sale_promotion/COPYRIGHT | 4 +- modules/sale_promotion/MANIFEST.in | 6 - modules/sale_promotion/doc/conf.py | 22 +- .../sale_promotion/doc/requirements-doc.txt | 1 + modules/sale_promotion/pyproject.toml | 63 + modules/sale_promotion/setup.py | 131 -- modules/sale_promotion/tox.ini | 4 +- modules/sale_promotion_coupon/COPYRIGHT | 3 +- modules/sale_promotion_coupon/MANIFEST.in | 6 - modules/sale_promotion_coupon/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_promotion_coupon/pyproject.toml | 60 + modules/sale_promotion_coupon/setup.py | 127 -- modules/sale_promotion_coupon/tox.ini | 4 +- .../sale_promotion_coupon_payment/COPYRIGHT | 4 +- .../sale_promotion_coupon_payment/MANIFEST.in | 6 - .../sale_promotion_coupon_payment/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 60 + .../sale_promotion_coupon_payment/setup.py | 135 -- modules/sale_promotion_coupon_payment/tox.ini | 4 +- modules/sale_rental/.readthedocs.yaml | 10 - modules/sale_rental/COPYRIGHT | 4 +- modules/sale_rental/MANIFEST.in | 6 - modules/sale_rental/doc/conf.py | 22 +- modules/sale_rental/doc/requirements-doc.txt | 1 + modules/sale_rental/pyproject.toml | 60 + modules/sale_rental/setup.py | 137 -- modules/sale_rental/tox.ini | 4 +- .../sale_rental_progress_invoice/COPYRIGHT | 3 +- .../sale_rental_progress_invoice/MANIFEST.in | 6 - .../sale_rental_progress_invoice/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 60 + modules/sale_rental_progress_invoice/setup.py | 138 -- modules/sale_rental_progress_invoice/tox.ini | 4 +- modules/sale_secondary_unit/COPYRIGHT | 4 +- modules/sale_secondary_unit/MANIFEST.in | 6 - modules/sale_secondary_unit/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_secondary_unit/pyproject.toml | 60 + modules/sale_secondary_unit/setup.py | 133 -- modules/sale_secondary_unit/tox.ini | 4 +- modules/sale_shipment_cost/COPYRIGHT | 8 +- modules/sale_shipment_cost/MANIFEST.in | 6 - modules/sale_shipment_cost/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_shipment_cost/pyproject.toml | 60 + modules/sale_shipment_cost/setup.py | 135 -- modules/sale_shipment_cost/tox.ini | 4 +- modules/sale_shipment_grouping/COPYRIGHT | 4 +- modules/sale_shipment_grouping/MANIFEST.in | 6 - modules/sale_shipment_grouping/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_shipment_grouping/pyproject.toml | 60 + modules/sale_shipment_grouping/setup.py | 126 -- modules/sale_shipment_grouping/tox.ini | 4 +- modules/sale_shipment_tolerance/COPYRIGHT | 4 +- modules/sale_shipment_tolerance/MANIFEST.in | 6 - modules/sale_shipment_tolerance/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../sale_shipment_tolerance/pyproject.toml | 60 + modules/sale_shipment_tolerance/setup.py | 127 -- modules/sale_shipment_tolerance/tox.ini | 4 +- modules/sale_stock_quantity/COPYRIGHT | 4 +- modules/sale_stock_quantity/MANIFEST.in | 6 - modules/sale_stock_quantity/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_stock_quantity/pyproject.toml | 60 + modules/sale_stock_quantity/setup.py | 133 -- modules/sale_stock_quantity/tox.ini | 4 +- modules/sale_subscription/COPYRIGHT | 4 +- modules/sale_subscription/MANIFEST.in | 6 - modules/sale_subscription/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_subscription/pyproject.toml | 60 + modules/sale_subscription/setup.py | 129 -- modules/sale_subscription/tox.ini | 4 +- modules/sale_subscription_asset/COPYRIGHT | 6 +- modules/sale_subscription_asset/MANIFEST.in | 6 - modules/sale_subscription_asset/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../sale_subscription_asset/pyproject.toml | 60 + modules/sale_subscription_asset/setup.py | 129 -- modules/sale_subscription_asset/tox.ini | 4 +- modules/sale_supply/COPYRIGHT | 4 +- modules/sale_supply/MANIFEST.in | 6 - modules/sale_supply/doc/conf.py | 22 +- modules/sale_supply/doc/requirements-doc.txt | 1 + modules/sale_supply/pyproject.toml | 60 + modules/sale_supply/setup.py | 131 -- modules/sale_supply/tox.ini | 4 +- modules/sale_supply_drop_shipment/COPYRIGHT | 4 +- modules/sale_supply_drop_shipment/MANIFEST.in | 6 - modules/sale_supply_drop_shipment/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../sale_supply_drop_shipment/pyproject.toml | 60 + modules/sale_supply_drop_shipment/setup.py | 134 -- modules/sale_supply_drop_shipment/tox.ini | 4 +- modules/sale_supply_production/COPYRIGHT | 4 +- modules/sale_supply_production/MANIFEST.in | 6 - modules/sale_supply_production/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/sale_supply_production/pyproject.toml | 60 + modules/sale_supply_production/setup.py | 135 -- modules/sale_supply_production/tox.ini | 4 +- modules/stock/COPYRIGHT | 10 +- modules/stock/MANIFEST.in | 6 - modules/stock/doc/conf.py | 22 +- modules/stock/doc/requirements-doc.txt | 1 + modules/stock/pyproject.toml | 62 + modules/stock/setup.py | 132 -- modules/stock/tox.ini | 4 +- modules/stock_assign_manual/COPYRIGHT | 3 +- modules/stock_assign_manual/MANIFEST.in | 6 - modules/stock_assign_manual/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_assign_manual/pyproject.toml | 59 + modules/stock_assign_manual/setup.py | 135 -- modules/stock_assign_manual/tox.ini | 4 +- modules/stock_consignment/COPYRIGHT | 4 +- modules/stock_consignment/MANIFEST.in | 6 - modules/stock_consignment/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_consignment/pyproject.toml | 59 + modules/stock_consignment/setup.py | 130 -- modules/stock_consignment/tox.ini | 4 +- modules/stock_forecast/COPYRIGHT | 6 +- modules/stock_forecast/MANIFEST.in | 6 - modules/stock_forecast/doc/conf.py | 22 +- .../stock_forecast/doc/requirements-doc.txt | 1 + modules/stock_forecast/pyproject.toml | 62 + modules/stock_forecast/setup.py | 132 -- modules/stock_forecast/tox.ini | 4 +- modules/stock_inventory_location/COPYRIGHT | 6 +- modules/stock_inventory_location/MANIFEST.in | 6 - modules/stock_inventory_location/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../stock_inventory_location/pyproject.toml | 59 + modules/stock_inventory_location/setup.py | 129 -- modules/stock_inventory_location/tox.ini | 4 +- modules/stock_location_move/COPYRIGHT | 3 +- modules/stock_location_move/MANIFEST.in | 6 - modules/stock_location_move/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_location_move/pyproject.toml | 59 + modules/stock_location_move/setup.py | 129 -- modules/stock_location_move/tox.ini | 4 +- modules/stock_location_sequence/COPYRIGHT | 6 +- modules/stock_location_sequence/MANIFEST.in | 6 - modules/stock_location_sequence/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../stock_location_sequence/pyproject.toml | 59 + modules/stock_location_sequence/setup.py | 129 -- modules/stock_location_sequence/tox.ini | 4 +- modules/stock_lot/COPYRIGHT | 4 +- modules/stock_lot/MANIFEST.in | 6 - modules/stock_lot/doc/conf.py | 22 +- modules/stock_lot/doc/requirements-doc.txt | 1 + modules/stock_lot/pyproject.toml | 59 + modules/stock_lot/setup.py | 134 -- modules/stock_lot/tox.ini | 4 +- modules/stock_lot_sled/COPYRIGHT | 6 +- modules/stock_lot_sled/MANIFEST.in | 6 - modules/stock_lot_sled/doc/conf.py | 22 +- .../stock_lot_sled/doc/requirements-doc.txt | 1 + modules/stock_lot_sled/pyproject.toml | 59 + modules/stock_lot_sled/setup.py | 128 -- modules/stock_lot_sled/tox.ini | 4 +- modules/stock_lot_unit/COPYRIGHT | 6 +- modules/stock_lot_unit/MANIFEST.in | 6 - modules/stock_lot_unit/doc/conf.py | 22 +- .../stock_lot_unit/doc/requirements-doc.txt | 1 + modules/stock_lot_unit/pyproject.toml | 59 + modules/stock_lot_unit/setup.py | 128 -- modules/stock_lot_unit/tox.ini | 4 +- modules/stock_package/COPYRIGHT | 4 +- modules/stock_package/MANIFEST.in | 6 - modules/stock_package/doc/conf.py | 22 +- .../stock_package/doc/requirements-doc.txt | 1 + modules/stock_package/pyproject.toml | 59 + modules/stock_package/setup.py | 128 -- modules/stock_package/tox.ini | 4 +- modules/stock_package_shipping/COPYRIGHT | 4 +- modules/stock_package_shipping/MANIFEST.in | 6 - modules/stock_package_shipping/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_package_shipping/pyproject.toml | 59 + modules/stock_package_shipping/setup.py | 132 -- modules/stock_package_shipping/tox.ini | 4 +- modules/stock_package_shipping_dpd/COPYRIGHT | 4 +- .../stock_package_shipping_dpd/MANIFEST.in | 6 - .../stock_package_shipping_dpd/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../stock_package_shipping_dpd/pyproject.toml | 67 + modules/stock_package_shipping_dpd/setup.py | 134 -- modules/stock_package_shipping_dpd/tox.ini | 4 +- .../stock_package_shipping_mygls/COPYRIGHT | 4 +- .../stock_package_shipping_mygls/MANIFEST.in | 6 - .../stock_package_shipping_mygls/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 66 + modules/stock_package_shipping_mygls/setup.py | 138 -- modules/stock_package_shipping_mygls/tox.ini | 4 +- .../COPYRIGHT | 4 +- .../MANIFEST.in | 6 - .../doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 63 + .../stock_package_shipping_sendcloud/setup.py | 140 -- .../stock_package_shipping_sendcloud/tox.ini | 4 +- modules/stock_package_shipping_ups/COPYRIGHT | 4 +- .../stock_package_shipping_ups/MANIFEST.in | 6 - .../stock_package_shipping_ups/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../stock_package_shipping_ups/pyproject.toml | 67 + modules/stock_package_shipping_ups/setup.py | 140 -- modules/stock_package_shipping_ups/tox.ini | 4 +- modules/stock_product_location/COPYRIGHT | 6 +- modules/stock_product_location/MANIFEST.in | 6 - modules/stock_product_location/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_product_location/pyproject.toml | 59 + modules/stock_product_location/setup.py | 135 -- modules/stock_product_location/tox.ini | 4 +- .../stock_product_location_place/COPYRIGHT | 4 +- .../stock_product_location_place/MANIFEST.in | 6 - .../stock_product_location_place/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 59 + modules/stock_product_location_place/setup.py | 134 -- modules/stock_product_location_place/tox.ini | 4 +- .../stock_quantity_early_planning/COPYRIGHT | 3 +- .../stock_quantity_early_planning/MANIFEST.in | 6 - .../stock_quantity_early_planning/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 59 + .../stock_quantity_early_planning/setup.py | 136 -- modules/stock_quantity_early_planning/tox.ini | 4 +- modules/stock_quantity_issue/COPYRIGHT | 3 +- modules/stock_quantity_issue/MANIFEST.in | 6 - modules/stock_quantity_issue/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_quantity_issue/pyproject.toml | 59 + modules/stock_quantity_issue/setup.py | 137 -- modules/stock_quantity_issue/tox.ini | 4 +- modules/stock_secondary_unit/COPYRIGHT | 4 +- modules/stock_secondary_unit/MANIFEST.in | 6 - modules/stock_secondary_unit/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_secondary_unit/pyproject.toml | 59 + modules/stock_secondary_unit/setup.py | 128 -- modules/stock_secondary_unit/tox.ini | 4 +- modules/stock_shipment_cost/COPYRIGHT | 4 +- modules/stock_shipment_cost/MANIFEST.in | 6 - modules/stock_shipment_cost/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_shipment_cost/pyproject.toml | 59 + modules/stock_shipment_cost/setup.py | 133 -- modules/stock_shipment_cost/tox.ini | 4 +- modules/stock_shipment_cost_weight/COPYRIGHT | 4 +- .../stock_shipment_cost_weight/MANIFEST.in | 6 - .../stock_shipment_cost_weight/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../stock_shipment_cost_weight/pyproject.toml | 59 + modules/stock_shipment_cost_weight/setup.py | 134 -- modules/stock_shipment_cost_weight/tox.ini | 4 +- modules/stock_shipment_customs/COPYRIGHT | 4 +- modules/stock_shipment_customs/MANIFEST.in | 6 - modules/stock_shipment_customs/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_shipment_customs/pyproject.toml | 59 + modules/stock_shipment_customs/setup.py | 133 -- modules/stock_shipment_customs/tox.ini | 4 +- modules/stock_shipment_measurements/COPYRIGHT | 4 +- .../stock_shipment_measurements/MANIFEST.in | 6 - .../stock_shipment_measurements/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 59 + modules/stock_shipment_measurements/setup.py | 127 -- modules/stock_shipment_measurements/tox.ini | 4 +- modules/stock_shipping_point/COPYRIGHT | 4 +- modules/stock_shipping_point/MANIFEST.in | 6 - modules/stock_shipping_point/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_shipping_point/pyproject.toml | 62 + modules/stock_shipping_point/setup.py | 138 -- modules/stock_shipping_point/tox.ini | 4 +- modules/stock_split/COPYRIGHT | 4 +- modules/stock_split/MANIFEST.in | 6 - modules/stock_split/doc/conf.py | 22 +- modules/stock_split/doc/requirements-doc.txt | 1 + modules/stock_split/pyproject.toml | 59 + modules/stock_split/setup.py | 132 -- modules/stock_split/tox.ini | 4 +- modules/stock_supply/COPYRIGHT | 8 +- modules/stock_supply/MANIFEST.in | 6 - modules/stock_supply/doc/conf.py | 22 +- modules/stock_supply/doc/requirements-doc.txt | 1 + modules/stock_supply/pyproject.toml | 59 + modules/stock_supply/setup.py | 128 -- modules/stock_supply/tox.ini | 4 +- modules/stock_supply_day/COPYRIGHT | 6 +- modules/stock_supply_day/MANIFEST.in | 6 - modules/stock_supply_day/doc/conf.py | 22 +- .../stock_supply_day/doc/requirements-doc.txt | 1 + modules/stock_supply_day/pyproject.toml | 59 + modules/stock_supply_day/setup.py | 127 -- modules/stock_supply_day/tox.ini | 4 +- modules/stock_supply_forecast/COPYRIGHT | 4 +- modules/stock_supply_forecast/MANIFEST.in | 6 - modules/stock_supply_forecast/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + modules/stock_supply_forecast/pyproject.toml | 59 + modules/stock_supply_forecast/setup.py | 129 -- modules/stock_supply_forecast/tox.ini | 4 +- modules/stock_supply_production/COPYRIGHT | 4 +- modules/stock_supply_production/MANIFEST.in | 6 - modules/stock_supply_production/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../stock_supply_production/pyproject.toml | 59 + modules/stock_supply_production/setup.py | 129 -- modules/stock_supply_production/tox.ini | 4 +- modules/timesheet/COPYRIGHT | 6 +- modules/timesheet/MANIFEST.in | 6 - modules/timesheet/doc/conf.py | 22 +- modules/timesheet/doc/requirements-doc.txt | 1 + modules/timesheet/pyproject.toml | 59 + modules/timesheet/setup.py | 131 -- modules/timesheet/tox.ini | 4 +- modules/timesheet_cost/COPYRIGHT | 4 +- modules/timesheet_cost/MANIFEST.in | 6 - modules/timesheet_cost/doc/conf.py | 22 +- .../timesheet_cost/doc/requirements-doc.txt | 1 + modules/timesheet_cost/pyproject.toml | 59 + modules/timesheet_cost/setup.py | 128 -- modules/timesheet_cost/tox.ini | 4 +- modules/user_role/COPYRIGHT | 3 +- modules/user_role/doc/conf.py | 22 +- modules/user_role/doc/requirements-doc.txt | 1 + modules/user_role/pyproject.toml | 59 + modules/user_role/setup.py | 128 -- modules/user_role/tox.ini | 4 +- modules/web_shop/COPYRIGHT | 4 +- modules/web_shop/MANIFEST.in | 6 - modules/web_shop/doc/conf.py | 22 +- modules/web_shop/doc/requirements-doc.txt | 1 + modules/web_shop/pyproject.toml | 59 + modules/web_shop/setup.py | 134 -- modules/web_shop/tox.ini | 4 +- modules/web_shop_product_data_feed/COPYRIGHT | 4 +- .../web_shop_product_data_feed/MANIFEST.in | 6 - .../web_shop_product_data_feed/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../web_shop_product_data_feed/pyproject.toml | 60 + modules/web_shop_product_data_feed/setup.py | 140 -- modules/web_shop_product_data_feed/tox.ini | 4 +- modules/web_shop_shopify/COPYRIGHT | 4 +- modules/web_shop_shopify/MANIFEST.in | 6 - modules/web_shop_shopify/doc/conf.py | 22 +- .../web_shop_shopify/doc/requirements-doc.txt | 1 + modules/web_shop_shopify/pyproject.toml | 68 + modules/web_shop_shopify/setup.py | 148 -- modules/web_shop_shopify/tox.ini | 4 +- modules/web_shop_vue_storefront/COPYRIGHT | 4 +- modules/web_shop_vue_storefront/MANIFEST.in | 6 - modules/web_shop_vue_storefront/doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../web_shop_vue_storefront/pyproject.toml | 62 + modules/web_shop_vue_storefront/setup.py | 139 -- modules/web_shop_vue_storefront/tox.ini | 4 +- .../web_shop_vue_storefront_stripe/COPYRIGHT | 4 +- .../MANIFEST.in | 6 - .../doc/conf.py | 22 +- .../doc/requirements-doc.txt | 1 + .../pyproject.toml | 59 + .../web_shop_vue_storefront_stripe/setup.py | 132 -- .../web_shop_vue_storefront_stripe/tox.ini | 4 +- modules/web_shortener/COPYRIGHT | 6 +- modules/web_shortener/MANIFEST.in | 6 - modules/web_shortener/doc/conf.py | 22 +- .../web_shortener/doc/requirements-doc.txt | 1 + modules/web_shortener/pyproject.toml | 59 + modules/web_shortener/setup.py | 128 -- modules/web_shortener/tox.ini | 4 +- modules/web_user/COPYRIGHT | 4 +- modules/web_user/MANIFEST.in | 6 - modules/web_user/doc/conf.py | 22 +- modules/web_user/doc/requirements-doc.txt | 1 + modules/web_user/pyproject.toml | 60 + modules/web_user/setup.py | 132 -- modules/web_user/tox.ini | 4 +- proteus/COPYRIGHT | 4 +- proteus/MANIFEST.in | 5 - proteus/doc/conf.py | 22 +- proteus/doc/requirements-doc.txt | 1 + proteus/pyproject.toml | 55 + proteus/setup.py | 98 -- proteus/tox.ini | 4 +- sao/COPYRIGHT | 8 +- tryton/COPYRIGHT | 20 +- tryton/MANIFEST.in | 15 - tryton/doc/conf.py | 26 +- tryton/doc/requirements-doc.txt | 1 + tryton/hatch_build.py | 26 + tryton/make-darwin-installer.sh | 4 +- tryton/make-win32-installer.sh | 4 +- tryton/pyproject.toml | 57 + tryton/setup-freeze.py | 10 +- tryton/setup.cfg | 19 - tryton/setup.py | 148 -- tryton/tox.ini | 4 +- trytond-gis/COPYRIGHT | 6 +- trytond-gis/MANIFEST.in | 5 - trytond-gis/doc/conf.py | 22 +- trytond-gis/doc/requirements-doc.txt | 1 + trytond-gis/pyproject.toml | 56 + trytond-gis/setup.py | 96 -- trytond-gis/tox.ini | 6 +- trytond/COPYRIGHT | 12 +- trytond/MANIFEST.in | 9 - trytond/bin/trytond | 82 +- trytond/bin/trytond-admin | 23 +- trytond/bin/trytond-console | 20 +- trytond/bin/trytond-cron | 29 +- trytond/bin/trytond-stat | 132 +- trytond/bin/trytond-worker | 28 +- trytond/doc/conf.py | 22 +- trytond/doc/requirements-doc.txt | 1 + trytond/hatch_build.py | 27 + trytond/pyproject.toml | 96 ++ trytond/setup.py | 169 -- trytond/tox.ini | 4 +- trytond/trytond/cli/__init__.py | 91 ++ trytond/trytond/cli/__main__.py | 8 + trytond/trytond/cli/admin.py | 25 + trytond/trytond/cli/console.py | 22 + trytond/trytond/cli/cron.py | 29 + trytond/trytond/cli/stat.py | 138 ++ trytond/trytond/cli/worker.py | 29 + trytond/trytond/commandline.py | 9 + trytond/trytond/ir/ui/board.rng | 739 --------- trytond/trytond/ir/ui/calendar.rng | 145 -- trytond/trytond/ir/ui/form.rng | 1449 ----------------- trytond/trytond/ir/ui/graph.rng | 218 --- trytond/trytond/ir/ui/tree.rng | 563 ------- trytond/trytond/tryton.rng | 234 --- 1590 files changed, 17346 insertions(+), 38132 deletions(-) create mode 100644 cookiecutter-module/{{ cookiecutter.module_name }}/pyproject.toml delete mode 100755 cookiecutter-module/{{ cookiecutter.module_name }}/setup.py delete mode 100644 modules/account/MANIFEST.in create mode 100644 modules/account/pyproject.toml delete mode 100755 modules/account/setup.py delete mode 100644 modules/account_asset/MANIFEST.in create mode 100644 modules/account_asset/pyproject.toml delete mode 100755 modules/account_asset/setup.py delete mode 100644 modules/account_be/MANIFEST.in create mode 100644 modules/account_be/pyproject.toml delete mode 100755 modules/account_be/setup.py delete mode 100644 modules/account_budget/MANIFEST.in create mode 100644 modules/account_budget/pyproject.toml delete mode 100755 modules/account_budget/setup.py delete mode 100644 modules/account_cash_rounding/MANIFEST.in create mode 100644 modules/account_cash_rounding/pyproject.toml delete mode 100755 modules/account_cash_rounding/setup.py delete mode 100644 modules/account_consolidation/MANIFEST.in mode change 100644 => 120000 modules/account_consolidation/README.rst create mode 100644 modules/account_consolidation/pyproject.toml delete mode 100755 modules/account_consolidation/setup.py delete mode 100644 modules/account_credit_limit/MANIFEST.in create mode 100644 modules/account_credit_limit/pyproject.toml delete mode 100755 modules/account_credit_limit/setup.py delete mode 100644 modules/account_de_skr03/MANIFEST.in create mode 100644 modules/account_de_skr03/pyproject.toml delete mode 100755 modules/account_de_skr03/setup.py delete mode 100644 modules/account_deposit/MANIFEST.in create mode 100644 modules/account_deposit/pyproject.toml delete mode 100755 modules/account_deposit/setup.py delete mode 100644 modules/account_dunning/MANIFEST.in create mode 100644 modules/account_dunning/pyproject.toml delete mode 100755 modules/account_dunning/setup.py delete mode 100644 modules/account_dunning_email/MANIFEST.in create mode 100644 modules/account_dunning_email/pyproject.toml delete mode 100755 modules/account_dunning_email/setup.py delete mode 100644 modules/account_dunning_fee/MANIFEST.in create mode 100644 modules/account_dunning_fee/pyproject.toml delete mode 100755 modules/account_dunning_fee/setup.py delete mode 100644 modules/account_dunning_letter/MANIFEST.in create mode 100644 modules/account_dunning_letter/pyproject.toml delete mode 100755 modules/account_dunning_letter/setup.py delete mode 100644 modules/account_es/MANIFEST.in create mode 100644 modules/account_es/pyproject.toml delete mode 100755 modules/account_es/setup.py delete mode 100644 modules/account_es_sii/MANIFEST.in create mode 100644 modules/account_es_sii/pyproject.toml delete mode 100755 modules/account_es_sii/setup.py delete mode 100644 modules/account_eu/MANIFEST.in create mode 100644 modules/account_eu/pyproject.toml delete mode 100755 modules/account_eu/setup.py delete mode 100644 modules/account_export/MANIFEST.in create mode 100644 modules/account_export/pyproject.toml delete mode 100755 modules/account_export/setup.py delete mode 100644 modules/account_export_winbooks/MANIFEST.in create mode 100644 modules/account_export_winbooks/pyproject.toml delete mode 100755 modules/account_export_winbooks/setup.py delete mode 100644 modules/account_fr/MANIFEST.in create mode 100644 modules/account_fr/pyproject.toml delete mode 100755 modules/account_fr/setup.py delete mode 100644 modules/account_fr_chorus/MANIFEST.in create mode 100644 modules/account_fr_chorus/pyproject.toml delete mode 100755 modules/account_fr_chorus/setup.py delete mode 100644 modules/account_invoice/MANIFEST.in create mode 100644 modules/account_invoice/pyproject.toml delete mode 100755 modules/account_invoice/setup.py delete mode 100644 modules/account_invoice_correction/MANIFEST.in create mode 100644 modules/account_invoice_correction/pyproject.toml delete mode 100755 modules/account_invoice_correction/setup.py delete mode 100644 modules/account_invoice_defer/MANIFEST.in create mode 100644 modules/account_invoice_defer/pyproject.toml delete mode 100755 modules/account_invoice_defer/setup.py delete mode 100644 modules/account_invoice_history/MANIFEST.in create mode 100644 modules/account_invoice_history/pyproject.toml delete mode 100755 modules/account_invoice_history/setup.py delete mode 100644 modules/account_invoice_line_standalone/MANIFEST.in create mode 100644 modules/account_invoice_line_standalone/pyproject.toml delete mode 100755 modules/account_invoice_line_standalone/setup.py delete mode 100644 modules/account_invoice_secondary_unit/MANIFEST.in create mode 100644 modules/account_invoice_secondary_unit/pyproject.toml delete mode 100755 modules/account_invoice_secondary_unit/setup.py delete mode 100644 modules/account_invoice_stock/MANIFEST.in create mode 100644 modules/account_invoice_stock/pyproject.toml delete mode 100755 modules/account_invoice_stock/setup.py delete mode 100644 modules/account_invoice_watermark/MANIFEST.in create mode 100644 modules/account_invoice_watermark/pyproject.toml delete mode 100755 modules/account_invoice_watermark/setup.py delete mode 100644 modules/account_move_line_grouping/MANIFEST.in create mode 100644 modules/account_move_line_grouping/pyproject.toml delete mode 100755 modules/account_move_line_grouping/setup.py delete mode 100644 modules/account_payment/MANIFEST.in create mode 100644 modules/account_payment/pyproject.toml delete mode 100755 modules/account_payment/setup.py delete mode 100644 modules/account_payment_braintree/MANIFEST.in create mode 100644 modules/account_payment_braintree/pyproject.toml delete mode 100755 modules/account_payment_braintree/setup.py delete mode 100644 modules/account_payment_clearing/MANIFEST.in create mode 100644 modules/account_payment_clearing/pyproject.toml delete mode 100755 modules/account_payment_clearing/setup.py delete mode 100644 modules/account_payment_sepa/MANIFEST.in create mode 100644 modules/account_payment_sepa/pyproject.toml delete mode 100755 modules/account_payment_sepa/setup.py delete mode 100644 modules/account_payment_sepa_cfonb/MANIFEST.in create mode 100644 modules/account_payment_sepa_cfonb/pyproject.toml delete mode 100755 modules/account_payment_sepa_cfonb/setup.py delete mode 100644 modules/account_payment_stripe/MANIFEST.in create mode 100644 modules/account_payment_stripe/pyproject.toml delete mode 100755 modules/account_payment_stripe/setup.py delete mode 100644 modules/account_product/MANIFEST.in create mode 100644 modules/account_product/pyproject.toml delete mode 100755 modules/account_product/setup.py delete mode 100644 modules/account_receivable_rule/MANIFEST.in create mode 100644 modules/account_receivable_rule/pyproject.toml delete mode 100755 modules/account_receivable_rule/setup.py delete mode 100644 modules/account_rule/MANIFEST.in create mode 100644 modules/account_rule/pyproject.toml delete mode 100755 modules/account_rule/setup.py delete mode 100644 modules/account_statement/MANIFEST.in create mode 100644 modules/account_statement/pyproject.toml delete mode 100755 modules/account_statement/setup.py delete mode 100644 modules/account_statement_aeb43/MANIFEST.in create mode 100644 modules/account_statement_aeb43/pyproject.toml delete mode 100755 modules/account_statement_aeb43/setup.py delete mode 100644 modules/account_statement_coda/MANIFEST.in create mode 100644 modules/account_statement_coda/pyproject.toml delete mode 100755 modules/account_statement_coda/setup.py delete mode 100644 modules/account_statement_mt940/MANIFEST.in create mode 100644 modules/account_statement_mt940/pyproject.toml delete mode 100755 modules/account_statement_mt940/setup.py delete mode 100644 modules/account_statement_ofx/MANIFEST.in create mode 100644 modules/account_statement_ofx/pyproject.toml delete mode 100755 modules/account_statement_ofx/setup.py delete mode 100644 modules/account_statement_rule/MANIFEST.in create mode 100644 modules/account_statement_rule/pyproject.toml delete mode 100755 modules/account_statement_rule/setup.py delete mode 100644 modules/account_statement_sepa/MANIFEST.in create mode 100644 modules/account_statement_sepa/pyproject.toml delete mode 100755 modules/account_statement_sepa/setup.py delete mode 100644 modules/account_stock_anglo_saxon/MANIFEST.in create mode 100644 modules/account_stock_anglo_saxon/pyproject.toml delete mode 100755 modules/account_stock_anglo_saxon/setup.py delete mode 100644 modules/account_stock_continental/MANIFEST.in create mode 100644 modules/account_stock_continental/pyproject.toml delete mode 100755 modules/account_stock_continental/setup.py delete mode 100644 modules/account_stock_eu/MANIFEST.in create mode 100644 modules/account_stock_eu/pyproject.toml delete mode 100755 modules/account_stock_eu/setup.py delete mode 100644 modules/account_stock_landed_cost/MANIFEST.in create mode 100644 modules/account_stock_landed_cost/pyproject.toml delete mode 100755 modules/account_stock_landed_cost/setup.py delete mode 100644 modules/account_stock_landed_cost_weight/MANIFEST.in create mode 100644 modules/account_stock_landed_cost_weight/pyproject.toml delete mode 100755 modules/account_stock_landed_cost_weight/setup.py delete mode 100644 modules/account_stock_shipment_cost/MANIFEST.in create mode 100644 modules/account_stock_shipment_cost/pyproject.toml delete mode 100755 modules/account_stock_shipment_cost/setup.py delete mode 100644 modules/account_stock_shipment_cost_weight/MANIFEST.in create mode 100644 modules/account_stock_shipment_cost_weight/pyproject.toml delete mode 100755 modules/account_stock_shipment_cost_weight/setup.py delete mode 100644 modules/account_syscohada/MANIFEST.in create mode 100644 modules/account_syscohada/pyproject.toml delete mode 100755 modules/account_syscohada/setup.py delete mode 100644 modules/account_tax_cash/MANIFEST.in create mode 100644 modules/account_tax_cash/pyproject.toml delete mode 100755 modules/account_tax_cash/setup.py delete mode 100644 modules/account_tax_non_deductible/MANIFEST.in create mode 100644 modules/account_tax_non_deductible/pyproject.toml delete mode 100755 modules/account_tax_non_deductible/setup.py delete mode 100644 modules/account_tax_rule_country/MANIFEST.in create mode 100644 modules/account_tax_rule_country/pyproject.toml delete mode 100755 modules/account_tax_rule_country/setup.py delete mode 100644 modules/analytic_account/MANIFEST.in create mode 100644 modules/analytic_account/pyproject.toml delete mode 100755 modules/analytic_account/setup.py delete mode 100644 modules/analytic_budget/MANIFEST.in create mode 100644 modules/analytic_budget/pyproject.toml delete mode 100755 modules/analytic_budget/setup.py delete mode 100644 modules/analytic_invoice/MANIFEST.in create mode 100644 modules/analytic_invoice/pyproject.toml delete mode 100755 modules/analytic_invoice/setup.py delete mode 100644 modules/analytic_purchase/MANIFEST.in create mode 100644 modules/analytic_purchase/pyproject.toml delete mode 100755 modules/analytic_purchase/setup.py delete mode 100644 modules/analytic_sale/MANIFEST.in create mode 100644 modules/analytic_sale/pyproject.toml delete mode 100755 modules/analytic_sale/setup.py delete mode 100644 modules/attendance/MANIFEST.in mode change 100644 => 120000 modules/attendance/README.rst create mode 100644 modules/attendance/pyproject.toml delete mode 100755 modules/attendance/setup.py delete mode 100644 modules/authentication_saml/MANIFEST.in create mode 100644 modules/authentication_saml/pyproject.toml delete mode 100755 modules/authentication_saml/setup.py delete mode 100644 modules/authentication_sms/MANIFEST.in create mode 100644 modules/authentication_sms/pyproject.toml delete mode 100755 modules/authentication_sms/setup.py delete mode 100644 modules/bank/MANIFEST.in create mode 100644 modules/bank/pyproject.toml delete mode 100755 modules/bank/setup.py delete mode 100644 modules/carrier/MANIFEST.in create mode 100644 modules/carrier/pyproject.toml delete mode 100755 modules/carrier/setup.py delete mode 100644 modules/carrier_carriage/MANIFEST.in create mode 100644 modules/carrier_carriage/pyproject.toml delete mode 100755 modules/carrier_carriage/setup.py delete mode 100644 modules/carrier_percentage/MANIFEST.in create mode 100644 modules/carrier_percentage/pyproject.toml delete mode 100755 modules/carrier_percentage/setup.py delete mode 100644 modules/carrier_subdivision/MANIFEST.in mode change 100644 => 120000 modules/carrier_subdivision/README.rst create mode 100644 modules/carrier_subdivision/pyproject.toml delete mode 100755 modules/carrier_subdivision/setup.py delete mode 100644 modules/carrier_weight/MANIFEST.in create mode 100644 modules/carrier_weight/pyproject.toml delete mode 100755 modules/carrier_weight/setup.py delete mode 100644 modules/commission/MANIFEST.in create mode 100644 modules/commission/pyproject.toml delete mode 100755 modules/commission/setup.py delete mode 100644 modules/commission_waiting/MANIFEST.in create mode 100644 modules/commission_waiting/pyproject.toml delete mode 100755 modules/commission_waiting/setup.py delete mode 100644 modules/company/MANIFEST.in create mode 100644 modules/company/pyproject.toml delete mode 100755 modules/company/setup.py delete mode 100644 modules/company_work_time/MANIFEST.in create mode 100644 modules/company_work_time/pyproject.toml delete mode 100755 modules/company_work_time/setup.py delete mode 100644 modules/country/MANIFEST.in create mode 100644 modules/country/pyproject.toml delete mode 100755 modules/country/setup.py delete mode 100644 modules/currency/MANIFEST.in create mode 100644 modules/currency/pyproject.toml delete mode 100755 modules/currency/setup.py delete mode 100644 modules/currency_ro/MANIFEST.in create mode 100644 modules/currency_ro/pyproject.toml delete mode 100755 modules/currency_ro/setup.py delete mode 100644 modules/currency_rs/MANIFEST.in create mode 100644 modules/currency_rs/pyproject.toml delete mode 100755 modules/currency_rs/setup.py delete mode 100644 modules/customs/MANIFEST.in create mode 100644 modules/customs/pyproject.toml delete mode 100755 modules/customs/setup.py delete mode 100644 modules/dashboard/MANIFEST.in create mode 100644 modules/dashboard/pyproject.toml delete mode 100755 modules/dashboard/setup.py delete mode 100644 modules/document_incoming/MANIFEST.in create mode 100644 modules/document_incoming/pyproject.toml delete mode 100755 modules/document_incoming/setup.py delete mode 100644 modules/document_incoming_invoice/MANIFEST.in create mode 100644 modules/document_incoming_invoice/pyproject.toml delete mode 100755 modules/document_incoming_invoice/setup.py delete mode 100644 modules/document_incoming_ocr/MANIFEST.in create mode 100644 modules/document_incoming_ocr/pyproject.toml delete mode 100755 modules/document_incoming_ocr/setup.py delete mode 100644 modules/document_incoming_ocr_typless/MANIFEST.in create mode 100644 modules/document_incoming_ocr_typless/pyproject.toml delete mode 100755 modules/document_incoming_ocr_typless/setup.py delete mode 100644 modules/edocument_peppol/MANIFEST.in create mode 100644 modules/edocument_peppol/pyproject.toml delete mode 100755 modules/edocument_peppol/setup.py delete mode 100644 modules/edocument_peppol_peppyrus/MANIFEST.in create mode 100644 modules/edocument_peppol_peppyrus/pyproject.toml delete mode 100755 modules/edocument_peppol_peppyrus/setup.py delete mode 100644 modules/edocument_ubl/MANIFEST.in create mode 100644 modules/edocument_ubl/pyproject.toml delete mode 100755 modules/edocument_ubl/setup.py delete mode 100644 modules/edocument_uncefact/MANIFEST.in create mode 100644 modules/edocument_uncefact/pyproject.toml delete mode 100755 modules/edocument_uncefact/setup.py delete mode 100644 modules/edocument_unece/MANIFEST.in create mode 100644 modules/edocument_unece/pyproject.toml delete mode 100755 modules/edocument_unece/setup.py delete mode 100644 modules/google_maps/MANIFEST.in create mode 100644 modules/google_maps/pyproject.toml delete mode 100755 modules/google_maps/setup.py delete mode 100644 modules/inbound_email/MANIFEST.in create mode 100644 modules/inbound_email/pyproject.toml delete mode 100755 modules/inbound_email/setup.py delete mode 100644 modules/incoterm/MANIFEST.in create mode 100644 modules/incoterm/pyproject.toml delete mode 100755 modules/incoterm/setup.py delete mode 100644 modules/ldap_authentication/MANIFEST.in create mode 100644 modules/ldap_authentication/pyproject.toml delete mode 100755 modules/ldap_authentication/setup.py delete mode 100644 modules/marketing/MANIFEST.in create mode 100644 modules/marketing/pyproject.toml delete mode 100755 modules/marketing/setup.py delete mode 100644 modules/marketing_automation/MANIFEST.in create mode 100644 modules/marketing_automation/pyproject.toml delete mode 100755 modules/marketing_automation/setup.py delete mode 100644 modules/marketing_campaign/MANIFEST.in create mode 100644 modules/marketing_campaign/pyproject.toml delete mode 100755 modules/marketing_campaign/setup.py delete mode 100644 modules/marketing_email/MANIFEST.in create mode 100644 modules/marketing_email/pyproject.toml delete mode 100755 modules/marketing_email/setup.py delete mode 100644 modules/notification_email/MANIFEST.in create mode 100644 modules/notification_email/pyproject.toml delete mode 100755 modules/notification_email/setup.py delete mode 100644 modules/party/MANIFEST.in create mode 100644 modules/party/pyproject.toml delete mode 100755 modules/party/setup.py delete mode 100644 modules/party_avatar/MANIFEST.in create mode 100644 modules/party_avatar/pyproject.toml delete mode 100755 modules/party_avatar/setup.py delete mode 100644 modules/party_relationship/MANIFEST.in create mode 100644 modules/party_relationship/pyproject.toml delete mode 100755 modules/party_relationship/setup.py delete mode 100644 modules/party_siret/MANIFEST.in create mode 100644 modules/party_siret/pyproject.toml delete mode 100755 modules/party_siret/setup.py delete mode 100644 modules/product/MANIFEST.in create mode 100644 modules/product/pyproject.toml delete mode 100755 modules/product/setup.py delete mode 100644 modules/product_attribute/MANIFEST.in create mode 100644 modules/product_attribute/pyproject.toml delete mode 100755 modules/product_attribute/setup.py delete mode 100644 modules/product_classification/MANIFEST.in create mode 100644 modules/product_classification/pyproject.toml delete mode 100755 modules/product_classification/setup.py delete mode 100644 modules/product_classification_taxonomic/MANIFEST.in create mode 100644 modules/product_classification_taxonomic/pyproject.toml delete mode 100755 modules/product_classification_taxonomic/setup.py delete mode 100644 modules/product_cost_fifo/MANIFEST.in create mode 100644 modules/product_cost_fifo/pyproject.toml delete mode 100755 modules/product_cost_fifo/setup.py delete mode 100644 modules/product_cost_history/MANIFEST.in create mode 100644 modules/product_cost_history/pyproject.toml delete mode 100755 modules/product_cost_history/setup.py delete mode 100644 modules/product_cost_warehouse/MANIFEST.in create mode 100644 modules/product_cost_warehouse/pyproject.toml delete mode 100755 modules/product_cost_warehouse/setup.py delete mode 100644 modules/product_image/MANIFEST.in create mode 100644 modules/product_image/pyproject.toml delete mode 100755 modules/product_image/setup.py delete mode 100644 modules/product_image_attribute/MANIFEST.in create mode 100644 modules/product_image_attribute/pyproject.toml delete mode 100755 modules/product_image_attribute/setup.py delete mode 100644 modules/product_kit/MANIFEST.in create mode 100644 modules/product_kit/pyproject.toml delete mode 100755 modules/product_kit/setup.py delete mode 100644 modules/product_measurements/MANIFEST.in create mode 100644 modules/product_measurements/pyproject.toml delete mode 100755 modules/product_measurements/setup.py delete mode 100644 modules/product_price_list/MANIFEST.in create mode 100644 modules/product_price_list/pyproject.toml delete mode 100755 modules/product_price_list/setup.py delete mode 100644 modules/product_price_list_cache/MANIFEST.in create mode 100644 modules/product_price_list_cache/pyproject.toml delete mode 100755 modules/product_price_list_cache/setup.py delete mode 100644 modules/product_price_list_dates/MANIFEST.in create mode 100644 modules/product_price_list_dates/pyproject.toml delete mode 100755 modules/product_price_list_dates/setup.py delete mode 100644 modules/product_price_list_parent/MANIFEST.in create mode 100644 modules/product_price_list_parent/pyproject.toml delete mode 100755 modules/product_price_list_parent/setup.py delete mode 100644 modules/production/MANIFEST.in create mode 100644 modules/production/pyproject.toml delete mode 100755 modules/production/setup.py delete mode 100644 modules/production_outsourcing/MANIFEST.in create mode 100644 modules/production_outsourcing/pyproject.toml delete mode 100755 modules/production_outsourcing/setup.py delete mode 100644 modules/production_routing/MANIFEST.in create mode 100644 modules/production_routing/pyproject.toml delete mode 100755 modules/production_routing/setup.py delete mode 100644 modules/production_split/MANIFEST.in create mode 100644 modules/production_split/pyproject.toml delete mode 100755 modules/production_split/setup.py delete mode 100644 modules/production_work/MANIFEST.in create mode 100644 modules/production_work/pyproject.toml delete mode 100755 modules/production_work/setup.py delete mode 100644 modules/production_work_timesheet/MANIFEST.in create mode 100644 modules/production_work_timesheet/pyproject.toml delete mode 100755 modules/production_work_timesheet/setup.py delete mode 100644 modules/project/MANIFEST.in create mode 100644 modules/project/pyproject.toml delete mode 100755 modules/project/setup.py delete mode 100644 modules/project_invoice/MANIFEST.in create mode 100644 modules/project_invoice/pyproject.toml delete mode 100755 modules/project_invoice/setup.py delete mode 100644 modules/project_plan/MANIFEST.in create mode 100644 modules/project_plan/pyproject.toml delete mode 100755 modules/project_plan/setup.py delete mode 100644 modules/project_revenue/MANIFEST.in create mode 100644 modules/project_revenue/pyproject.toml delete mode 100755 modules/project_revenue/setup.py delete mode 100644 modules/purchase/MANIFEST.in create mode 100644 modules/purchase/pyproject.toml delete mode 100755 modules/purchase/setup.py delete mode 100644 modules/purchase_amendment/MANIFEST.in create mode 100644 modules/purchase_amendment/pyproject.toml delete mode 100755 modules/purchase_amendment/setup.py delete mode 100644 modules/purchase_blanket_agreement/MANIFEST.in mode change 100644 => 120000 modules/purchase_blanket_agreement/README.rst create mode 100644 modules/purchase_blanket_agreement/pyproject.toml delete mode 100755 modules/purchase_blanket_agreement/setup.py delete mode 100644 modules/purchase_history/MANIFEST.in create mode 100644 modules/purchase_history/pyproject.toml delete mode 100755 modules/purchase_history/setup.py delete mode 100644 modules/purchase_invoice_line_standalone/MANIFEST.in create mode 100644 modules/purchase_invoice_line_standalone/pyproject.toml delete mode 100755 modules/purchase_invoice_line_standalone/setup.py delete mode 100644 modules/purchase_price_list/MANIFEST.in create mode 100644 modules/purchase_price_list/pyproject.toml delete mode 100755 modules/purchase_price_list/setup.py delete mode 100644 modules/purchase_product_quantity/MANIFEST.in create mode 100644 modules/purchase_product_quantity/pyproject.toml delete mode 100755 modules/purchase_product_quantity/setup.py delete mode 100644 modules/purchase_request/MANIFEST.in create mode 100644 modules/purchase_request/pyproject.toml delete mode 100755 modules/purchase_request/setup.py delete mode 100644 modules/purchase_request_quotation/MANIFEST.in create mode 100644 modules/purchase_request_quotation/pyproject.toml delete mode 100755 modules/purchase_request_quotation/setup.py delete mode 100644 modules/purchase_requisition/MANIFEST.in create mode 100644 modules/purchase_requisition/pyproject.toml delete mode 100755 modules/purchase_requisition/setup.py delete mode 100644 modules/purchase_secondary_unit/MANIFEST.in create mode 100644 modules/purchase_secondary_unit/pyproject.toml delete mode 100755 modules/purchase_secondary_unit/setup.py delete mode 100644 modules/purchase_shipment_cost/MANIFEST.in create mode 100644 modules/purchase_shipment_cost/pyproject.toml delete mode 100755 modules/purchase_shipment_cost/setup.py delete mode 100644 modules/quality/MANIFEST.in create mode 100644 modules/quality/pyproject.toml delete mode 100755 modules/quality/setup.py delete mode 100644 modules/sale/MANIFEST.in create mode 100644 modules/sale/pyproject.toml delete mode 100755 modules/sale/setup.py delete mode 100644 modules/sale_advance_payment/MANIFEST.in create mode 100644 modules/sale_advance_payment/pyproject.toml delete mode 100755 modules/sale_advance_payment/setup.py delete mode 100644 modules/sale_amendment/MANIFEST.in create mode 100644 modules/sale_amendment/pyproject.toml delete mode 100755 modules/sale_amendment/setup.py delete mode 100644 modules/sale_blanket_agreement/MANIFEST.in mode change 100644 => 120000 modules/sale_blanket_agreement/README.rst create mode 100644 modules/sale_blanket_agreement/pyproject.toml delete mode 100755 modules/sale_blanket_agreement/setup.py delete mode 100644 modules/sale_complaint/MANIFEST.in create mode 100644 modules/sale_complaint/pyproject.toml delete mode 100755 modules/sale_complaint/setup.py delete mode 100644 modules/sale_credit_limit/MANIFEST.in create mode 100644 modules/sale_credit_limit/pyproject.toml delete mode 100755 modules/sale_credit_limit/setup.py delete mode 100644 modules/sale_discount/MANIFEST.in create mode 100644 modules/sale_discount/pyproject.toml delete mode 100755 modules/sale_discount/setup.py delete mode 100644 modules/sale_extra/MANIFEST.in create mode 100644 modules/sale_extra/pyproject.toml delete mode 100755 modules/sale_extra/setup.py delete mode 100644 modules/sale_gift_card/MANIFEST.in create mode 100644 modules/sale_gift_card/pyproject.toml delete mode 100755 modules/sale_gift_card/setup.py delete mode 100644 modules/sale_history/MANIFEST.in create mode 100644 modules/sale_history/pyproject.toml delete mode 100755 modules/sale_history/setup.py delete mode 100644 modules/sale_invoice_date/MANIFEST.in create mode 100644 modules/sale_invoice_date/pyproject.toml delete mode 100755 modules/sale_invoice_date/setup.py delete mode 100644 modules/sale_invoice_grouping/MANIFEST.in create mode 100644 modules/sale_invoice_grouping/pyproject.toml delete mode 100755 modules/sale_invoice_grouping/setup.py delete mode 100644 modules/sale_opportunity/MANIFEST.in create mode 100644 modules/sale_opportunity/pyproject.toml delete mode 100755 modules/sale_opportunity/setup.py delete mode 100644 modules/sale_payment/MANIFEST.in create mode 100644 modules/sale_payment/pyproject.toml delete mode 100755 modules/sale_payment/setup.py delete mode 100644 modules/sale_point/MANIFEST.in create mode 100644 modules/sale_point/pyproject.toml delete mode 100755 modules/sale_point/setup.py delete mode 100644 modules/sale_price_list/MANIFEST.in create mode 100644 modules/sale_price_list/pyproject.toml delete mode 100755 modules/sale_price_list/setup.py delete mode 100644 modules/sale_product_customer/MANIFEST.in create mode 100644 modules/sale_product_customer/pyproject.toml delete mode 100755 modules/sale_product_customer/setup.py delete mode 100644 modules/sale_product_quantity/MANIFEST.in create mode 100644 modules/sale_product_quantity/pyproject.toml delete mode 100755 modules/sale_product_quantity/setup.py delete mode 100644 modules/sale_product_recommendation/MANIFEST.in create mode 100644 modules/sale_product_recommendation/pyproject.toml delete mode 100755 modules/sale_product_recommendation/setup.py delete mode 100644 modules/sale_product_recommendation_association_rule/MANIFEST.in create mode 100644 modules/sale_product_recommendation_association_rule/pyproject.toml delete mode 100755 modules/sale_product_recommendation_association_rule/setup.py delete mode 100644 modules/sale_promotion/MANIFEST.in create mode 100644 modules/sale_promotion/pyproject.toml delete mode 100755 modules/sale_promotion/setup.py delete mode 100644 modules/sale_promotion_coupon/MANIFEST.in create mode 100644 modules/sale_promotion_coupon/pyproject.toml delete mode 100755 modules/sale_promotion_coupon/setup.py delete mode 100644 modules/sale_promotion_coupon_payment/MANIFEST.in create mode 100644 modules/sale_promotion_coupon_payment/pyproject.toml delete mode 100755 modules/sale_promotion_coupon_payment/setup.py delete mode 100644 modules/sale_rental/.readthedocs.yaml delete mode 100644 modules/sale_rental/MANIFEST.in create mode 100644 modules/sale_rental/pyproject.toml delete mode 100755 modules/sale_rental/setup.py delete mode 100644 modules/sale_rental_progress_invoice/MANIFEST.in create mode 100644 modules/sale_rental_progress_invoice/pyproject.toml delete mode 100755 modules/sale_rental_progress_invoice/setup.py delete mode 100644 modules/sale_secondary_unit/MANIFEST.in create mode 100644 modules/sale_secondary_unit/pyproject.toml delete mode 100755 modules/sale_secondary_unit/setup.py delete mode 100644 modules/sale_shipment_cost/MANIFEST.in create mode 100644 modules/sale_shipment_cost/pyproject.toml delete mode 100755 modules/sale_shipment_cost/setup.py delete mode 100644 modules/sale_shipment_grouping/MANIFEST.in create mode 100644 modules/sale_shipment_grouping/pyproject.toml delete mode 100755 modules/sale_shipment_grouping/setup.py delete mode 100644 modules/sale_shipment_tolerance/MANIFEST.in create mode 100644 modules/sale_shipment_tolerance/pyproject.toml delete mode 100755 modules/sale_shipment_tolerance/setup.py delete mode 100644 modules/sale_stock_quantity/MANIFEST.in create mode 100644 modules/sale_stock_quantity/pyproject.toml delete mode 100755 modules/sale_stock_quantity/setup.py delete mode 100644 modules/sale_subscription/MANIFEST.in create mode 100644 modules/sale_subscription/pyproject.toml delete mode 100755 modules/sale_subscription/setup.py delete mode 100644 modules/sale_subscription_asset/MANIFEST.in create mode 100644 modules/sale_subscription_asset/pyproject.toml delete mode 100755 modules/sale_subscription_asset/setup.py delete mode 100644 modules/sale_supply/MANIFEST.in create mode 100644 modules/sale_supply/pyproject.toml delete mode 100755 modules/sale_supply/setup.py delete mode 100644 modules/sale_supply_drop_shipment/MANIFEST.in create mode 100644 modules/sale_supply_drop_shipment/pyproject.toml delete mode 100755 modules/sale_supply_drop_shipment/setup.py delete mode 100644 modules/sale_supply_production/MANIFEST.in create mode 100644 modules/sale_supply_production/pyproject.toml delete mode 100755 modules/sale_supply_production/setup.py delete mode 100644 modules/stock/MANIFEST.in create mode 100644 modules/stock/pyproject.toml delete mode 100755 modules/stock/setup.py delete mode 100644 modules/stock_assign_manual/MANIFEST.in create mode 100644 modules/stock_assign_manual/pyproject.toml delete mode 100755 modules/stock_assign_manual/setup.py delete mode 100644 modules/stock_consignment/MANIFEST.in create mode 100644 modules/stock_consignment/pyproject.toml delete mode 100755 modules/stock_consignment/setup.py delete mode 100644 modules/stock_forecast/MANIFEST.in create mode 100644 modules/stock_forecast/pyproject.toml delete mode 100755 modules/stock_forecast/setup.py delete mode 100644 modules/stock_inventory_location/MANIFEST.in create mode 100644 modules/stock_inventory_location/pyproject.toml delete mode 100755 modules/stock_inventory_location/setup.py delete mode 100644 modules/stock_location_move/MANIFEST.in create mode 100644 modules/stock_location_move/pyproject.toml delete mode 100755 modules/stock_location_move/setup.py delete mode 100644 modules/stock_location_sequence/MANIFEST.in create mode 100644 modules/stock_location_sequence/pyproject.toml delete mode 100755 modules/stock_location_sequence/setup.py delete mode 100644 modules/stock_lot/MANIFEST.in create mode 100644 modules/stock_lot/pyproject.toml delete mode 100755 modules/stock_lot/setup.py delete mode 100644 modules/stock_lot_sled/MANIFEST.in create mode 100644 modules/stock_lot_sled/pyproject.toml delete mode 100755 modules/stock_lot_sled/setup.py delete mode 100644 modules/stock_lot_unit/MANIFEST.in create mode 100644 modules/stock_lot_unit/pyproject.toml delete mode 100755 modules/stock_lot_unit/setup.py delete mode 100644 modules/stock_package/MANIFEST.in create mode 100644 modules/stock_package/pyproject.toml delete mode 100755 modules/stock_package/setup.py delete mode 100644 modules/stock_package_shipping/MANIFEST.in create mode 100644 modules/stock_package_shipping/pyproject.toml delete mode 100755 modules/stock_package_shipping/setup.py delete mode 100644 modules/stock_package_shipping_dpd/MANIFEST.in create mode 100644 modules/stock_package_shipping_dpd/pyproject.toml delete mode 100755 modules/stock_package_shipping_dpd/setup.py delete mode 100644 modules/stock_package_shipping_mygls/MANIFEST.in create mode 100644 modules/stock_package_shipping_mygls/pyproject.toml delete mode 100755 modules/stock_package_shipping_mygls/setup.py delete mode 100644 modules/stock_package_shipping_sendcloud/MANIFEST.in create mode 100644 modules/stock_package_shipping_sendcloud/pyproject.toml delete mode 100755 modules/stock_package_shipping_sendcloud/setup.py delete mode 100644 modules/stock_package_shipping_ups/MANIFEST.in create mode 100644 modules/stock_package_shipping_ups/pyproject.toml delete mode 100755 modules/stock_package_shipping_ups/setup.py delete mode 100644 modules/stock_product_location/MANIFEST.in create mode 100644 modules/stock_product_location/pyproject.toml delete mode 100755 modules/stock_product_location/setup.py delete mode 100644 modules/stock_product_location_place/MANIFEST.in create mode 100644 modules/stock_product_location_place/pyproject.toml delete mode 100755 modules/stock_product_location_place/setup.py delete mode 100644 modules/stock_quantity_early_planning/MANIFEST.in create mode 100644 modules/stock_quantity_early_planning/pyproject.toml delete mode 100755 modules/stock_quantity_early_planning/setup.py delete mode 100644 modules/stock_quantity_issue/MANIFEST.in create mode 100644 modules/stock_quantity_issue/pyproject.toml delete mode 100755 modules/stock_quantity_issue/setup.py delete mode 100644 modules/stock_secondary_unit/MANIFEST.in create mode 100644 modules/stock_secondary_unit/pyproject.toml delete mode 100755 modules/stock_secondary_unit/setup.py delete mode 100644 modules/stock_shipment_cost/MANIFEST.in create mode 100644 modules/stock_shipment_cost/pyproject.toml delete mode 100755 modules/stock_shipment_cost/setup.py delete mode 100644 modules/stock_shipment_cost_weight/MANIFEST.in create mode 100644 modules/stock_shipment_cost_weight/pyproject.toml delete mode 100755 modules/stock_shipment_cost_weight/setup.py delete mode 100644 modules/stock_shipment_customs/MANIFEST.in create mode 100644 modules/stock_shipment_customs/pyproject.toml delete mode 100755 modules/stock_shipment_customs/setup.py delete mode 100644 modules/stock_shipment_measurements/MANIFEST.in create mode 100644 modules/stock_shipment_measurements/pyproject.toml delete mode 100755 modules/stock_shipment_measurements/setup.py delete mode 100644 modules/stock_shipping_point/MANIFEST.in create mode 100644 modules/stock_shipping_point/pyproject.toml delete mode 100755 modules/stock_shipping_point/setup.py delete mode 100644 modules/stock_split/MANIFEST.in create mode 100644 modules/stock_split/pyproject.toml delete mode 100755 modules/stock_split/setup.py delete mode 100644 modules/stock_supply/MANIFEST.in create mode 100644 modules/stock_supply/pyproject.toml delete mode 100755 modules/stock_supply/setup.py delete mode 100644 modules/stock_supply_day/MANIFEST.in create mode 100644 modules/stock_supply_day/pyproject.toml delete mode 100755 modules/stock_supply_day/setup.py delete mode 100644 modules/stock_supply_forecast/MANIFEST.in create mode 100644 modules/stock_supply_forecast/pyproject.toml delete mode 100755 modules/stock_supply_forecast/setup.py delete mode 100644 modules/stock_supply_production/MANIFEST.in create mode 100644 modules/stock_supply_production/pyproject.toml delete mode 100755 modules/stock_supply_production/setup.py delete mode 100644 modules/timesheet/MANIFEST.in create mode 100644 modules/timesheet/pyproject.toml delete mode 100755 modules/timesheet/setup.py delete mode 100644 modules/timesheet_cost/MANIFEST.in create mode 100644 modules/timesheet_cost/pyproject.toml delete mode 100755 modules/timesheet_cost/setup.py create mode 100644 modules/user_role/pyproject.toml delete mode 100755 modules/user_role/setup.py delete mode 100644 modules/web_shop/MANIFEST.in create mode 100644 modules/web_shop/pyproject.toml delete mode 100755 modules/web_shop/setup.py delete mode 100644 modules/web_shop_product_data_feed/MANIFEST.in create mode 100644 modules/web_shop_product_data_feed/pyproject.toml delete mode 100755 modules/web_shop_product_data_feed/setup.py delete mode 100644 modules/web_shop_shopify/MANIFEST.in create mode 100644 modules/web_shop_shopify/pyproject.toml delete mode 100755 modules/web_shop_shopify/setup.py delete mode 100644 modules/web_shop_vue_storefront/MANIFEST.in create mode 100644 modules/web_shop_vue_storefront/pyproject.toml delete mode 100755 modules/web_shop_vue_storefront/setup.py delete mode 100644 modules/web_shop_vue_storefront_stripe/MANIFEST.in create mode 100644 modules/web_shop_vue_storefront_stripe/pyproject.toml delete mode 100755 modules/web_shop_vue_storefront_stripe/setup.py delete mode 100644 modules/web_shortener/MANIFEST.in create mode 100644 modules/web_shortener/pyproject.toml delete mode 100755 modules/web_shortener/setup.py delete mode 100644 modules/web_user/MANIFEST.in create mode 100644 modules/web_user/pyproject.toml delete mode 100755 modules/web_user/setup.py delete mode 100644 proteus/MANIFEST.in create mode 100644 proteus/pyproject.toml delete mode 100755 proteus/setup.py delete mode 100644 tryton/MANIFEST.in create mode 100755 tryton/hatch_build.py create mode 100644 tryton/pyproject.toml delete mode 100644 tryton/setup.cfg delete mode 100755 tryton/setup.py delete mode 100644 trytond-gis/MANIFEST.in create mode 100644 trytond-gis/pyproject.toml delete mode 100755 trytond-gis/setup.py delete mode 100644 trytond/MANIFEST.in create mode 100755 trytond/hatch_build.py create mode 100644 trytond/pyproject.toml delete mode 100755 trytond/setup.py create mode 100644 trytond/trytond/cli/__init__.py create mode 100644 trytond/trytond/cli/__main__.py create mode 100644 trytond/trytond/cli/admin.py create mode 100644 trytond/trytond/cli/console.py create mode 100644 trytond/trytond/cli/cron.py create mode 100644 trytond/trytond/cli/stat.py create mode 100644 trytond/trytond/cli/worker.py delete mode 100644 trytond/trytond/ir/ui/board.rng delete mode 100644 trytond/trytond/ir/ui/calendar.rng delete mode 100644 trytond/trytond/ir/ui/form.rng delete mode 100644 trytond/trytond/ir/ui/graph.rng delete mode 100644 trytond/trytond/ir/ui/tree.rng delete mode 100644 trytond/trytond/tryton.rng diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fcbd881ac8..61b57cd23a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,12 @@ packages: image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/tryton/ci variables: DOC_BASE_URL: ${CI_PROJECT_DIR}/docs + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + cache: + paths: + - .cache/pip/http-v2 + before_script: + - pip install build "hatchling >= 1" hatch-tryton babel rnc2rng script: - .gitlab-scripts/generate-packages.sh packages artifacts: @@ -32,6 +38,14 @@ packages: documentation: stage: preparation image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/sphinxdoc/sphinx + variables: + DOC_NO_ISOLATION: true + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + cache: + paths: + - .cache/pip/http-v2 + before_script: + - pip install build "hatchling >= 1" hatch-tryton babel rnc2rng script: - .gitlab-scripts/generate-doc.sh docs - find docs -type f -not -name 'objects.inv' -delete @@ -60,13 +74,14 @@ documentation: variables: DOC_BASE_URL: ${CI_PROJECT_DIR}/docs DOC_DIR: doc + DOC_NO_ISOLATION: true PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" cache: paths: - .cache/pip/http-v2 before_script: - - pip install setuptools - pip install -r "${PACKAGE}/${DOC_DIR}/requirements-doc.txt" + - pip install build "hatchling >= 1" hatch-tryton babel rnc2rng - pip install sphinx-lint rstcheck[sphinx] script: - cd "${PACKAGE}" @@ -244,10 +259,10 @@ check-account-chart: coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' artifacts: reports: - junit: ${PACKAGE}/junit.xml + junit: ${PACKAGE}/.tox/junit.xml coverage_report: coverage_format: cobertura - path: ${PACKAGE}/coverage.xml + path: ${PACKAGE}/.tox/coverage.xml parallel: matrix: - PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"] @@ -313,26 +328,6 @@ check-doc-trytond: variables: PACKAGE: trytond -check-trytond-rng: - extends: .check - variables: - PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" - cache: - paths: - - .cache/pip/http-v2 - before_script: - - pip install rnc2rng - script: - - python trytond/setup.py update_rng - - | - if [ `hg status trytond| wc -l` -ne 0 ]; then - false - fi - rules: - - changes: - - trytond/**/*.rnc - - trytond/**/*.rng - test-trytond-sqlite: extends: .test-sqlite variables: diff --git a/.gitlab-scripts/check-template-modules.sh b/.gitlab-scripts/check-template-modules.sh index 1269209665..c12c9e40ba 100755 --- a/.gitlab-scripts/check-template-modules.sh +++ b/.gitlab-scripts/check-template-modules.sh @@ -3,7 +3,7 @@ set -eu OUTPUT=${1:-`mktemp -d`} -find modules -maxdepth 2 -name setup.py -print | while read path +find modules -maxdepth 2 -name pyproject.toml -print | while read path do path=`dirname "${path}"` module=`basename "${path}"` diff --git a/.gitlab-scripts/generate-ci.py b/.gitlab-scripts/generate-ci.py index 1a599c28d2..7266e4c2fc 100755 --- a/.gitlab-scripts/generate-ci.py +++ b/.gitlab-scripts/generate-ci.py @@ -62,7 +62,7 @@ def render(file): def all_packages(): root_dir = os.path.dirname(BASE_DIR) for filename in chain( - glob.glob('modules/*/setup.py', root_dir=root_dir)): + glob.glob('modules/*/pyproject.toml', root_dir=root_dir)): yield os.path.dirname(filename) diff --git a/.gitlab-scripts/generate-doc.sh b/.gitlab-scripts/generate-doc.sh index 3558b5d45f..a8dd87912f 100755 --- a/.gitlab-scripts/generate-doc.sh +++ b/.gitlab-scripts/generate-doc.sh @@ -9,7 +9,6 @@ export DOC_BASE_URL requirements=$(mktemp "${TMPDIR}/requirements-doc-XXXXXXXXXX.txt") find . -name 'cookiecutter*' -prune -o -path '*/doc/requirements-doc.txt' -exec cat {} + | sort | uniq > "${requirements}" -pip install setuptools pip install -r "${requirements}" (find . -name 'cookiecutter*' -prune -o -path '*/doc/conf.py' -print | while read path; do diff --git a/.gitlab-scripts/generate-packages.sh b/.gitlab-scripts/generate-packages.sh index 1d3514c08a..53ad4d4c3b 100755 --- a/.gitlab-scripts/generate-packages.sh +++ b/.gitlab-scripts/generate-packages.sh @@ -4,6 +4,6 @@ set -eu PACKAGES=`realpath "${1}"` mkdir -p "${PACKAGES}" -(find . -name 'cookiecutter*' -prune -o -name setup.py -print | while read path; do +(find . -name 'cookiecutter*' -prune -o -name pyproject.toml -print | while read path; do echo "`dirname ${path}`" -done) | xargs --max-procs=$(( `nproc` * 2)) -I '{}' sh -c "cd \"{}\" && python setup.py --quiet sdist --dist-dir \"${PACKAGES}\"" +done) | xargs --max-procs=$(( `nproc` * 2)) -I '{}' sh -c "cd \"{}\" && python -m build --no-isolation --wheel --quiet --outdir \"${PACKAGES}\"" diff --git a/.hgignore b/.hgignore index b24babb886..c9876f1155 100644 --- a/.hgignore +++ b/.hgignore @@ -1,5 +1,7 @@ syntax: glob *.py[cdo] +*.mo +*.rng *.egg-info dist/ build/ diff --git a/.hooks/link_modules b/.hooks/link_modules index 4d68d697ea..f0fda2a5a8 100755 --- a/.hooks/link_modules +++ b/.hooks/link_modules @@ -12,11 +12,11 @@ destination = os.path.join(root, 'trytond', 'trytond', 'modules') modules = set() try: - filenames = glob.glob('modules/*/setup.py', root_dir=root) + filenames = glob.glob('modules/*/pyproject.toml', root_dir=root) except TypeError: # If root_dir is not supported, fallback considering the hook is executed # from the repository root - filenames = glob.glob('modules/*/setup.py') + filenames = glob.glob('modules/*/pyproject.toml') for filename in filenames: modules.add(os.path.basename(os.path.dirname(filename))) diff --git a/.hooks/update_requirements b/.hooks/update_requirements index 03c552e764..8372f45444 100755 --- a/.hooks/update_requirements +++ b/.hooks/update_requirements @@ -3,10 +3,13 @@ # this repository contains the full copyright notices and license terms. import io +import json import os import subprocess from multiprocessing.dummy import Pool +from packaging.requirements import Requirement + root = os.path.dirname(os.path.dirname(__file__)) module_path = os.path.join(root, 'modules') @@ -23,64 +26,42 @@ development_dependencies = { FNULL = open(os.devnull, 'w') -def add_dependencies(package, path): - egg_info_name = '%s.egg-info' % package - egg_info = os.path.join(path, egg_info_name) - if (not os.path.isdir(egg_info) - or (os.path.getmtime(os.path.join(path, 'setup.py')) - > os.path.getmtime(os.path.join(egg_info, 'requires.txt'))) - or (os.path.exists(os.path.join(path, 'tryton.cfg')) - and os.path.getmtime(os.path.join(path, 'tryton.cfg')) - > os.path.getmtime(os.path.join(egg_info, 'requires.txt')))): - subprocess.call( - ['./setup.py', 'egg_info'], - cwd=path, - stdout=FNULL, - stderr=FNULL) - with io.open(os.path.join(egg_info, 'requires.txt')) as f: - development = False - for dependency in f.readlines(): - dependency = dependency.strip('\n') - # Do not include trytond requirements as we have its source code - if (not dependency - or dependency.startswith('trytond') - or dependency.startswith('proteus')): - continue - # Always include optional dependencies as development - if dependency[0].startswith('['): - development = True - continue - # Remove version numbers - for char in ['>', '<', '=']: - dependency = dependency.split(char)[0] - if development: - development_dependencies.add(dependency) - else: - dependencies.add(dependency) +def add_dependencies(package): + metadata = subprocess.check_output( + 'python -m build -n -q --metadata', + shell=True, encoding='utf-8', cwd=package).strip() + metadata = json.loads(metadata) + for requirement in metadata.get('requires_dist', []): + requirement = Requirement(requirement) + if (requirement.name.startswith('trytond') + or requirement.name in {'proteus', 'tryton'}): + continue + development = bool(requirement.marker) + requirement.marker = None + if development: + development_dependencies.add(requirement) + else: + dependencies.add(requirement) pool = Pool() -pool.apply_async(add_dependencies, - ('trytond', os.path.join(root, 'trytond'))) -pool.apply_async(add_dependencies, - ('tryton', os.path.join(root, 'tryton'))) -pool.apply_async(add_dependencies, - ('proteus', os.path.join(root, 'proteus'))) -pool.apply_async(add_dependencies, - ('trytond_gis', os.path.join(root, 'trytond-gis'))) +pool.apply_async(add_dependencies, (os.path.join(root, 'trytond'),)) +pool.apply_async(add_dependencies, (os.path.join(root, 'tryton'),)) +pool.apply_async(add_dependencies, (os.path.join(root, 'proteus'),)) +pool.apply_async(add_dependencies, (os.path.join(root, 'trytond-gis'),)) for module in os.listdir(module_path): path = os.path.join(module_path, module) if not os.path.isdir(path): continue - pool.apply_async( - add_dependencies, ('trytond_%s' % module, path)) + pool.apply_async(add_dependencies, (path,)) pool.close() pool.join() with io.open(os.path.join(root, 'requirements.txt'), 'w') as fp: - fp.writelines(map(lambda d: d + '\n', sorted(dependencies))) + fp.writelines(map(lambda d: d + '\n', sorted(map(str, dependencies)))) with io.open(os.path.join(root, 'requirements-dev.txt'), 'w') as fp: - fp.writelines(map(lambda d: d + '\n', sorted(development_dependencies))) + fp.writelines( + map(lambda d: d + '\n', sorted(map(str, development_dependencies)))) diff --git a/README.rst b/README.rst index 73d659554b..665fb0a75c 100644 --- a/README.rst +++ b/README.rst @@ -41,9 +41,13 @@ the ``.hg/hgrc``: [hooks] update.modules = .hooks/link_modules update.requirements = .hooks/update_requirements + update.trytond = trytond/hatch_build.py + update.tryton = tryton/hatch_build.py -On ``hg update``, the first hook will automatically create symlinks for modules -and the second hook will automatically generate requirements files. +On ``hg update``, the first hook will automatically create symlinks for +modules, the second hook will automatically generate requirements files, the +third generate the ``RNG`` files for ``trytond`` and the last compile the +translation files for ``tryton``. Submit Change ============= diff --git a/cookiecutter-module/cookiecutter.json b/cookiecutter-module/cookiecutter.json index 4d0c0de09a..e64dc8abb2 100644 --- a/cookiecutter-module/cookiecutter.json +++ b/cookiecutter-module/cookiecutter.json @@ -4,10 +4,8 @@ "package_name": "{% if not cookiecutter.prefix %}trytond_{{ cookiecutter.module_name }}{% else %}{{ cookiecutter.prefix }}_{{ cookiecutter.module_name }}{% endif %}", "version": "{{ version }}", "description": "", - "author": "Tryton", - "author_email": "foundation@tryton.org", - "fullname": "", - "url": "http://www.tryton.org/", + "author": "", + "author_email": "", "keywords": "", "test_with_scenario": "", "_extensions": ["extensions.Version"] diff --git a/cookiecutter-module/hooks/post_gen_project.py b/cookiecutter-module/hooks/post_gen_project.py index e028d662d1..b5c6b69ab4 100644 --- a/cookiecutter-module/hooks/post_gen_project.py +++ b/cookiecutter-module/hooks/post_gen_project.py @@ -5,3 +5,10 @@ try: os.symlink('doc/index.rst', 'README.rst') except (AttributeError, OSError): shutil.copyfile('doc/index.rst', 'README.rst') + +{% if cookiecutter.prefix %} +try: + os.symlink('.', '{{ cookiecutter.package_name }}') +except (AttributeError, OSError): + pass +{% endif %} diff --git a/cookiecutter-module/{{ cookiecutter.module_name }}/COPYRIGHT b/cookiecutter-module/{{ cookiecutter.module_name }}/COPYRIGHT index 3dd7c33691..da580086f3 100644 --- a/cookiecutter-module/{{ cookiecutter.module_name }}/COPYRIGHT +++ b/cookiecutter-module/{{ cookiecutter.module_name }}/COPYRIGHT @@ -1,4 +1,4 @@ -Copyright (C) {% now 'local', '%Y' %} {{ cookiecutter.fullname }} +Copyright (C) {% now 'local', '%Y' %} {{ cookiecutter.author }}{% if cookiecutter.author_email %} <{{ cookiecutter.author_email }}>{% endif %} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/cookiecutter-module/{{ cookiecutter.module_name }}/doc/conf.py b/cookiecutter-module/{{ cookiecutter.module_name }}/doc/conf.py index 50d020c43c..4e0913ff4d 100644 --- a/cookiecutter-module/{{ cookiecutter.module_name }}/doc/conf.py +++ b/cookiecutter-module/{{ cookiecutter.module_name }}/doc/conf.py @@ -17,8 +17,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -26,17 +26,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/cookiecutter-module/{{ cookiecutter.module_name }}/doc/requirements-doc.txt b/cookiecutter-module/{{ cookiecutter.module_name }}/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/cookiecutter-module/{{ cookiecutter.module_name }}/doc/requirements-doc.txt +++ b/cookiecutter-module/{{ cookiecutter.module_name }}/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/cookiecutter-module/{{ cookiecutter.module_name }}/pyproject.toml b/cookiecutter-module/{{ cookiecutter.module_name }}/pyproject.toml new file mode 100644 index 0000000000..be06d388bf --- /dev/null +++ b/cookiecutter-module/{{ cookiecutter.module_name }}/pyproject.toml @@ -0,0 +1,89 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = '{{ cookiecutter.package_name }}' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ +{%- if cookiecutter.prefix %} + {name = "{{ cookiecutter.author }}", email = "{{ cookiecutter.author_email }}"}, +{%- else %} + {name = "Tryton", email = "foundation@tryton.org"}, +{%- endif %} + ] +description = "{{ cookiecutter.description }}" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = {{ cookiecutter.keywords.split() | tojson }} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", +{%- if cookiecutter.module_name.startswith('account') or cookiecutter.module_name.startswith('analytic_account')%} + "Topic :: Office/Business :: Financial :: Accounting", +{%- endif %} +{%- if cookiecutter.module_name.startswith('sale') %} + "Topic :: Office/Business :: Financial :: Point-Of-Sale", +{%- endif %} + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +{%- if cookiecutter.prefix %} +{{ cookiecutter.module_name }} = '{{ cookiecutter.package_name }}' +{%- else %} +{{ cookiecutter.module_name }} = 'trytond.modules.{{ cookiecutter.module_name }}' +{%- endif %} + +[project.urls] +{%- if not cookiecutter.prefix %} +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-{{ cookiecutter.module_name|replace('_', '-') }}/" +changelog = "https://docs.tryton.org/modules-{{ cookiecutter.module_name|replace('_', '-') }}/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" +{%- endif %} + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] +{%- if cookiecutter.prefix %} +dev-mode-dirs = ["."] +{%- endif %} + +[tool.hatch.build.targets.wheel.sources] +{%- if cookiecutter.prefix %} +"" = "{{ cookiecutter.module_name }}" +{%- else %} +"" = "trytond/modules/{{ cookiecutter.module_name }}" +{%- endif %} + +[tool.hatch.metadata.hooks.tryton] +{%- if cookiecutter.prefix %} +prefix = {} +{%- endif %} +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +{%- if cookiecutter.test_with_scenario %} +test = ['proteus'] +{%- else %} +test = [] +{%- endif %} diff --git a/cookiecutter-module/{{ cookiecutter.module_name }}/setup.py b/cookiecutter-module/{{ cookiecutter.module_name }}/setup.py deleted file mode 100755 index 657a923f32..0000000000 --- a/cookiecutter-module/{{ cookiecutter.module_name }}/setup.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env python3 -{% if not cookiecutter.prefix -%} -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -{% endif -%} -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup -{%- if cookiecutter.prefix %} - -MODULE2PREFIX = {} -{%- endif %} - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = '{{ cookiecutter.package_name }}' -{% if not cookiecutter.prefix %} -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) -{% endif %} -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): -{%- if not cookiecutter.prefix %} - requires.append(get_require_version('trytond_%s' % dep)) -{%- else %} - prefix = MODULE2PREFIX.get(dep, 'trytond') - requires.append(get_require_version('%s_%s' % (prefix, dep))) -{%- endif %} -requires.append(get_require_version('trytond')) - -{% if cookiecutter.test_with_scenario -%} -tests_require = [get_require_version('proteus')] -{%- else -%} -tests_require = [] -{%- endif %} - -setup(name=name, - version=version, - description='{{ cookiecutter.description }}', - long_description=read('README.rst'), - author='{{ cookiecutter.author }}', - author_email='{{ cookiecutter.author_email }}', - url='{{ cookiecutter.url }}', -{%- if not cookiecutter.prefix %} - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-{{ cookiecutter.module_name|replace('_', '-') }}', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, -{%- endif %} - keywords='{{ cookiecutter.keywords }}', - package_dir={'trytond.modules.{{ cookiecutter.module_name }}': '.'}, - packages=( - ['trytond.modules.{{ cookiecutter.module_name }}'] - + ['trytond.modules.{{ cookiecutter.module_name }}.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.{{ cookiecutter.module_name }}': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - {{ cookiecutter.module_name }} = trytond.modules.{{ cookiecutter.module_name }} - """, # noqa: E501 - ) diff --git a/cookiecutter-module/{{ cookiecutter.module_name }}/tox.ini b/cookiecutter-module/{{ cookiecutter.module_name }}/tox.ini index 53e3ce4cf0..f715bc3cb2 100644 --- a/cookiecutter-module/{{ cookiecutter.module_name }}/tox.ini +++ b/cookiecutter-module/{{ cookiecutter.module_name }}/tox.ini @@ -2,10 +2,14 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} +{%- if cookiecutter.prefix %} + coverage run --source={{ cookiecutter.module_name }} --omit=*/tests/* -m xmlrunner discover -s {{ cookiecutter.module_name }} {posargs} +{%- else %} + coverage run --source=trytond.modules.{{ cookiecutter.module_name }} --omit=*/tests/* -m xmlrunner discover -s trytond.modules.{{ cookiecutter.module_name }} {posargs} +{%- endif %} commands_post = coverage report coverage xml diff --git a/doc/conf.py b/doc/conf.py index e4e4c99da3..3a6740772a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -19,18 +19,20 @@ else: def get_info(): + import json import subprocess - import sys trytond_dir = os.path.join(os.path.dirname(__file__), '../trytond') info = dict() - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=trytond_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=trytond_dir).strip() + metadata = json.loads(metadata) + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/doc/requirements-doc.txt b/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/doc/requirements-doc.txt +++ b/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account/COPYRIGHT b/modules/account/COPYRIGHT index 2babb3e0a8..e35e734acd 100644 --- a/modules/account/COPYRIGHT +++ b/modules/account/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account/MANIFEST.in b/modules/account/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account/doc/conf.py b/modules/account/doc/conf.py index c17adbbdb3..4dca2bd835 100644 --- a/modules/account/doc/conf.py +++ b/modules/account/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account/doc/requirements-doc.txt b/modules/account/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account/doc/requirements-doc.txt +++ b/modules/account/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account/pyproject.toml b/modules/account/pyproject.toml new file mode 100644 index 0000000000..9847222139 --- /dev/null +++ b/modules/account/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Accounting for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account = 'trytond.modules.account' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account/" +changelog = "https://docs.tryton.org/modules-account/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-dateutil', + 'python-sql >= 0.7', + 'simpleeval', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account/setup.py b/modules/account/setup.py deleted file mode 100755 index d332608371..0000000000 --- a/modules/account/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-dateutil', 'python-sql >= 0.7', 'simpleeval'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for accounting', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-account/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account', - package_dir={'trytond.modules.account': '.'}, - packages=( - ['trytond.modules.account'] - + ['trytond.modules.account.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account = trytond.modules.account - """, - ) diff --git a/modules/account/tox.ini b/modules/account/tox.ini index 53e3ce4cf0..f44bb89af8 100644 --- a/modules/account/tox.ini +++ b/modules/account/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_asset/COPYRIGHT b/modules/account_asset/COPYRIGHT index f341671567..f4939ef967 100644 --- a/modules/account_asset/COPYRIGHT +++ b/modules/account_asset/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2012-2025 Nicolas Évrard. -Copyright (C) 2012-2025 Cédric Krier. -Copyright (C) 2012-2013 Bertrand Chenal. -Copyright (C) 2012-2025 B2CK SPRL. +Copyright (C) 2012-2025 Nicolas Évrard +Copyright (C) 2012-2025 Cédric Krier +Copyright (C) 2012-2013 Bertrand Chenal +Copyright (C) 2012-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_asset/MANIFEST.in b/modules/account_asset/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_asset/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_asset/doc/conf.py b/modules/account_asset/doc/conf.py index 86b4e0ce25..9e5cbe921d 100644 --- a/modules/account_asset/doc/conf.py +++ b/modules/account_asset/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_asset/doc/requirements-doc.txt b/modules/account_asset/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_asset/doc/requirements-doc.txt +++ b/modules/account_asset/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_asset/pyproject.toml b/modules/account_asset/pyproject.toml new file mode 100644 index 0000000000..e2ee85a551 --- /dev/null +++ b/modules/account_asset/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_asset' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Assets management for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "asset"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_asset = 'trytond.modules.account_asset' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-asset/" +changelog = "https://docs.tryton.org/modules-account-asset/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_asset" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-dateutil', + 'python-sql', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_asset/setup.py b/modules/account_asset/setup.py deleted file mode 100755 index 7caba2c3dc..0000000000 --- a/modules/account_asset/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_asset' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-dateutil', 'python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_purchase')] - -setup(name=name, - version=version, - description='Tryton module for assets management', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-asset'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account asset', - package_dir={'trytond.modules.account_asset': '.'}, - packages=( - ['trytond.modules.account_asset'] - + ['trytond.modules.account_asset.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_asset': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst', - '*.fodt']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_asset = trytond.modules.account_asset - """, - ) diff --git a/modules/account_asset/tox.ini b/modules/account_asset/tox.ini index 53e3ce4cf0..97cacbc48d 100644 --- a/modules/account_asset/tox.ini +++ b/modules/account_asset/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_asset --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_asset {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_be/COPYRIGHT b/modules/account_be/COPYRIGHT index 081457e309..a544f3c309 100644 --- a/modules/account_be/COPYRIGHT +++ b/modules/account_be/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2011 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2011 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_be/MANIFEST.in b/modules/account_be/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_be/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_be/doc/conf.py b/modules/account_be/doc/conf.py index 461d21e5bf..e26de28e1b 100644 --- a/modules/account_be/doc/conf.py +++ b/modules/account_be/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_be/doc/requirements-doc.txt b/modules/account_be/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_be/doc/requirements-doc.txt +++ b/modules/account_be/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_be/pyproject.toml b/modules/account_be/pyproject.toml new file mode 100644 index 0000000000..aa1d7a6770 --- /dev/null +++ b/modules/account_be/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_be' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Belgian chart of accounts for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "coa", "belgian"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Natural Language :: Dutch", + "Natural Language :: French", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_be = 'trytond.modules.account_be' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-be/" +changelog = "https://docs.tryton.org/modules-account-be/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_be" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-stdnum >= 2.2', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/account_be/setup.py b/modules/account_be/setup.py deleted file mode 100755 index d91f49c504..0000000000 --- a/modules/account_be/setup.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_be' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-stdnum >= 2.2'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('trytond_account_invoice'), - get_require_version('trytond_account_payment'), - get_require_version('trytond_account_statement_rule'), - ] - -setup(name=name, - version=version, - description='Tryton module with Belgian chart of accounts', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-account-be', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account chart belgian', - package_dir={'trytond.modules.account_be': '.'}, - packages=( - ['trytond.modules.account_be'] - + ['trytond.modules.account_be.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_be': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Dutch', - 'Natural Language :: French', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_be = trytond.modules.account_be - """, - ) diff --git a/modules/account_be/tox.ini b/modules/account_be/tox.ini index 53e3ce4cf0..39578ed379 100644 --- a/modules/account_be/tox.ini +++ b/modules/account_be/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_be --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_be {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_budget/COPYRIGHT b/modules/account_budget/COPYRIGHT index 1f73308cb4..0595a2babf 100644 --- a/modules/account_budget/COPYRIGHT +++ b/modules/account_budget/COPYRIGHT @@ -1,8 +1,8 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier Copyright (C) 2020-2021 David Harper Copyright (C) 2019 Adrián Bernardi -Copyright (C) 2016 Sergi Almacellas Abellana +Copyright (C) 2016 Sergi Almacellas Abellana This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_budget/MANIFEST.in b/modules/account_budget/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_budget/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_budget/doc/conf.py b/modules/account_budget/doc/conf.py index b7abcb196f..8b90cb49af 100644 --- a/modules/account_budget/doc/conf.py +++ b/modules/account_budget/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_budget/doc/requirements-doc.txt b/modules/account_budget/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_budget/doc/requirements-doc.txt +++ b/modules/account_budget/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_budget/pyproject.toml b/modules/account_budget/pyproject.toml new file mode 100644 index 0000000000..a4e6e3ded9 --- /dev/null +++ b/modules/account_budget/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_budget' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Accounting budget for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "budget"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_budget = 'trytond.modules.account_budget' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-budget/" +changelog = "https://docs.tryton.org/modules-account-budget/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_budget" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_budget/setup.py b/modules/account_budget/setup.py deleted file mode 100755 index 654fd27ba1..0000000000 --- a/modules/account_budget/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_budget' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module that allows budgets to be setup for accounts', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": - 'https://docs.tryton.org/modules-account-budget', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account budget', - package_dir={'trytond.modules.account_budget': '.'}, - packages=( - ['trytond.modules.account_budget'] - + ['trytond.modules.account_budget.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_budget': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_budget = trytond.modules.account_budget - """, # noqa: E501 - ) diff --git a/modules/account_budget/tox.ini b/modules/account_budget/tox.ini index 53e3ce4cf0..c788a23f11 100644 --- a/modules/account_budget/tox.ini +++ b/modules/account_budget/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_budget --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_budget {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_cash_rounding/COPYRIGHT b/modules/account_cash_rounding/COPYRIGHT index e42fe356fc..e7dd2b7778 100644 --- a/modules/account_cash_rounding/COPYRIGHT +++ b/modules/account_cash_rounding/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2019-2025 Cédric Krier -Copyright (C) 2019-2025 B2CK +Copyright (C) 2019-2025 Cédric Krier +Copyright (C) 2019-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_cash_rounding/MANIFEST.in b/modules/account_cash_rounding/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_cash_rounding/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_cash_rounding/doc/conf.py b/modules/account_cash_rounding/doc/conf.py index aeaeaba3de..0adbc64b22 100644 --- a/modules/account_cash_rounding/doc/conf.py +++ b/modules/account_cash_rounding/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_cash_rounding/doc/requirements-doc.txt b/modules/account_cash_rounding/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_cash_rounding/doc/requirements-doc.txt +++ b/modules/account_cash_rounding/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_cash_rounding/pyproject.toml b/modules/account_cash_rounding/pyproject.toml new file mode 100644 index 0000000000..b63ccb6c50 --- /dev/null +++ b/modules/account_cash_rounding/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_cash_rounding' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Round cash amount in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "cash", "rounding"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_cash_rounding = 'trytond.modules.account_cash_rounding' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-cash-rounding/" +changelog = "https://docs.tryton.org/modules-account-cash-rounding/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_cash_rounding" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_cash_rounding/setup.py b/modules/account_cash_rounding/setup.py deleted file mode 100755 index 5f77b57122..0000000000 --- a/modules/account_cash_rounding/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_cash_rounding' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] -for extra in info.get('extras_depend', []): - tests_require.append(get_require_version('trytond_%s' % extra)) - -setup(name=name, - version=version, - description='Tryton module to round cash amount', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-cash-rounding'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account cash rounding', - package_dir={'trytond.modules.account_cash_rounding': '.'}, - packages=( - ['trytond.modules.account_cash_rounding'] - + ['trytond.modules.account_cash_rounding.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_cash_rounding': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_cash_rounding = trytond.modules.account_cash_rounding - """, - ) diff --git a/modules/account_cash_rounding/tox.ini b/modules/account_cash_rounding/tox.ini index 53e3ce4cf0..570e5305c8 100644 --- a/modules/account_cash_rounding/tox.ini +++ b/modules/account_cash_rounding/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_cash_rounding --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_cash_rounding {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_consolidation/COPYRIGHT b/modules/account_consolidation/COPYRIGHT index 21963b7b9e..d99d12ebf9 100644 --- a/modules/account_consolidation/COPYRIGHT +++ b/modules/account_consolidation/COPYRIGHT @@ -1,6 +1,6 @@ Copyright (C) 2021 NaN-tic -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_consolidation/MANIFEST.in b/modules/account_consolidation/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_consolidation/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_consolidation/README.rst b/modules/account_consolidation/README.rst deleted file mode 100644 index 176d9c2695..0000000000 --- a/modules/account_consolidation/README.rst +++ /dev/null @@ -1 +0,0 @@ -doc/index.rst \ No newline at end of file diff --git a/modules/account_consolidation/README.rst b/modules/account_consolidation/README.rst new file mode 120000 index 0000000000..176d9c2695 --- /dev/null +++ b/modules/account_consolidation/README.rst @@ -0,0 +1 @@ +doc/index.rst \ No newline at end of file diff --git a/modules/account_consolidation/doc/conf.py b/modules/account_consolidation/doc/conf.py index abdb5a54e7..541ecf1268 100644 --- a/modules/account_consolidation/doc/conf.py +++ b/modules/account_consolidation/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_consolidation/doc/requirements-doc.txt b/modules/account_consolidation/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_consolidation/doc/requirements-doc.txt +++ b/modules/account_consolidation/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_consolidation/pyproject.toml b/modules/account_consolidation/pyproject.toml new file mode 100644 index 0000000000..961babf4b6 --- /dev/null +++ b/modules/account_consolidation/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_consolidation' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Consolidation of the accounting of many companies in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "consolidation"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_consolidation = 'trytond.modules.account_consolidation' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-consolidation/" +changelog = "https://docs.tryton.org/modules-account-consolidation/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_consolidation" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_consolidation/setup.py b/modules/account_consolidation/setup.py deleted file mode 100755 index 514f103a69..0000000000 --- a/modules/account_consolidation/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_consolidation' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_invoice'), - ] - -setup(name=name, - version=version, - description="Tryton module consolidate accounting of many companies", - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-account-consolidation'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account consolidation', - package_dir={'trytond.modules.account_consolidation': '.'}, - packages=( - ['trytond.modules.account_consolidation'] - + ['trytond.modules.account_consolidation.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_consolidation': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_consolidation = trytond.modules.account_consolidation - """, # noqa: E501 - ) diff --git a/modules/account_consolidation/tox.ini b/modules/account_consolidation/tox.ini index 53e3ce4cf0..f07536c124 100644 --- a/modules/account_consolidation/tox.ini +++ b/modules/account_consolidation/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_consolidation --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_consolidation {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_credit_limit/COPYRIGHT b/modules/account_credit_limit/COPYRIGHT index d61e4ef396..10c8c55375 100644 --- a/modules/account_credit_limit/COPYRIGHT +++ b/modules/account_credit_limit/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_credit_limit/MANIFEST.in b/modules/account_credit_limit/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_credit_limit/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_credit_limit/doc/conf.py b/modules/account_credit_limit/doc/conf.py index 92c72f0923..e281f60a75 100644 --- a/modules/account_credit_limit/doc/conf.py +++ b/modules/account_credit_limit/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_credit_limit/doc/requirements-doc.txt b/modules/account_credit_limit/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_credit_limit/doc/requirements-doc.txt +++ b/modules/account_credit_limit/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_credit_limit/pyproject.toml b/modules/account_credit_limit/pyproject.toml new file mode 100644 index 0000000000..bf337c6b7a --- /dev/null +++ b/modules/account_credit_limit/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_credit_limit' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Credit Limits for parties in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "credit limit"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_credit_limit = 'trytond.modules.account_credit_limit' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-credit-limit/" +changelog = "https://docs.tryton.org/modules-account-credit-limit/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_credit_limit" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/account_credit_limit/setup.py b/modules/account_credit_limit/setup.py deleted file mode 100755 index 17229877dc..0000000000 --- a/modules/account_credit_limit/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_credit_limit' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('trytond_account_dunning')] - -setup(name=name, - version=version, - description='Tryton module for account credit limit', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-credit-limit'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account credit limit', - package_dir={'trytond.modules.account_credit_limit': '.'}, - packages=( - ['trytond.modules.account_credit_limit'] - + ['trytond.modules.account_credit_limit.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_credit_limit': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_credit_limit = trytond.modules.account_credit_limit - """, - ) diff --git a/modules/account_credit_limit/tox.ini b/modules/account_credit_limit/tox.ini index 53e3ce4cf0..b36e9de091 100644 --- a/modules/account_credit_limit/tox.ini +++ b/modules/account_credit_limit/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_credit_limit --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_credit_limit {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_de_skr03/COPYRIGHT b/modules/account_de_skr03/COPYRIGHT index d17a99a27e..9892d39c07 100644 --- a/modules/account_de_skr03/COPYRIGHT +++ b/modules/account_de_skr03/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (c) 2008-2009 virtual things - Preisler & Spallek GbR. -Copyright (c) 2008-2021 Korbinian Preisler. -Copyright (c) 2009-2012 Mathias Behrle. +Copyright (c) 2008-2009 virtual things - Preisler & Spallek GbR +Copyright (c) 2008-2021 Korbinian Preisler +Copyright (c) 2009-2012 Mathias Behrle This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_de_skr03/MANIFEST.in b/modules/account_de_skr03/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_de_skr03/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_de_skr03/doc/conf.py b/modules/account_de_skr03/doc/conf.py index 28ee418fc7..cbf30139f2 100644 --- a/modules/account_de_skr03/doc/conf.py +++ b/modules/account_de_skr03/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_de_skr03/doc/requirements-doc.txt b/modules/account_de_skr03/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_de_skr03/doc/requirements-doc.txt +++ b/modules/account_de_skr03/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_de_skr03/pyproject.toml b/modules/account_de_skr03/pyproject.toml new file mode 100644 index 0000000000..f2ce5d5eee --- /dev/null +++ b/modules/account_de_skr03/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_de_skr03' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "German chart of accounts SKR03 for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "coa", "german"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_de_skr03 = 'trytond.modules.account_de_skr03' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-de-skr03/" +changelog = "https://docs.tryton.org/modules-account-de-skr03/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_de_skr03" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/account_de_skr03/setup.py b/modules/account_de_skr03/setup.py deleted file mode 100755 index bfe634474d..0000000000 --- a/modules/account_de_skr03/setup.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_de_skr03' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module with German chart of accounts SKR03', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-de-skr03'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account chart german SKR03', - package_dir={'trytond.modules.account_de_skr03': '.'}, - packages=( - ['trytond.modules.account_de_skr03'] - + ['trytond.modules.account_de_skr03.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_de_skr03': (info.get('xml', []) - + ['tryton.cfg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: German', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_de_skr03 = trytond.modules.account_de_skr03 - """, - ) diff --git a/modules/account_de_skr03/tox.ini b/modules/account_de_skr03/tox.ini index 53e3ce4cf0..ce5ee9959a 100644 --- a/modules/account_de_skr03/tox.ini +++ b/modules/account_de_skr03/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_de_skr03 --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_de_skr03 {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_deposit/COPYRIGHT b/modules/account_deposit/COPYRIGHT index 5dc3a55ac5..ac13c671f3 100644 --- a/modules/account_deposit/COPYRIGHT +++ b/modules/account_deposit/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2014-2025 Cédric Krier. -Copyright (C) 2014-2025 B2CK SPRL. +Copyright (C) 2014-2025 Cédric Krier +Copyright (C) 2014-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_deposit/MANIFEST.in b/modules/account_deposit/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_deposit/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_deposit/doc/conf.py b/modules/account_deposit/doc/conf.py index a7a385b7fa..7c3fb1868e 100644 --- a/modules/account_deposit/doc/conf.py +++ b/modules/account_deposit/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_deposit/doc/requirements-doc.txt b/modules/account_deposit/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_deposit/doc/requirements-doc.txt +++ b/modules/account_deposit/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_deposit/pyproject.toml b/modules/account_deposit/pyproject.toml new file mode 100644 index 0000000000..f4368cde8c --- /dev/null +++ b/modules/account_deposit/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_deposit' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Accounting deposit for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "deposit"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_deposit = 'trytond.modules.account_deposit' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-deposit/" +changelog = "https://docs.tryton.org/modules-account-deposit/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_deposit" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-dateutil', + 'python-sql >= 0.4', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_deposit/setup.py b/modules/account_deposit/setup.py deleted file mode 100755 index e41fc014a0..0000000000 --- a/modules/account_deposit/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_deposit' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-dateutil', 'python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_payment_clearing'), - ] - -setup(name=name, - version=version, - description='Tryton module for accounting deposit', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-deposit'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account deposit', - package_dir={'trytond.modules.account_deposit': '.'}, - packages=( - ['trytond.modules.account_deposit'] - + ['trytond.modules.account_deposit.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_deposit': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_deposit = trytond.modules.account_deposit - """, - ) diff --git a/modules/account_deposit/tox.ini b/modules/account_deposit/tox.ini index 53e3ce4cf0..7a6be6636c 100644 --- a/modules/account_deposit/tox.ini +++ b/modules/account_deposit/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_deposit --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_deposit {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_dunning/COPYRIGHT b/modules/account_dunning/COPYRIGHT index c5f9863cf1..a2d4e65b8c 100644 --- a/modules/account_dunning/COPYRIGHT +++ b/modules/account_dunning/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2013-2025 Cédric Krier. -Copyright (C) 2013-2025 B2CK SPRL. +Copyright (C) 2013-2025 Cédric Krier +Copyright (C) 2013-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_dunning/MANIFEST.in b/modules/account_dunning/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_dunning/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_dunning/doc/conf.py b/modules/account_dunning/doc/conf.py index cb5ccde858..16c535d883 100644 --- a/modules/account_dunning/doc/conf.py +++ b/modules/account_dunning/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_dunning/doc/requirements-doc.txt b/modules/account_dunning/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_dunning/doc/requirements-doc.txt +++ b/modules/account_dunning/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_dunning/pyproject.toml b/modules/account_dunning/pyproject.toml new file mode 100644 index 0000000000..ed9d326bf5 --- /dev/null +++ b/modules/account_dunning/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_dunning' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Accounting dunning for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "dunning"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_dunning = 'trytond.modules.account_dunning' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-dunning/" +changelog = "https://docs.tryton.org/modules-account-dunning/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_dunning" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql >= 0.4', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_dunning/setup.py b/modules/account_dunning/setup.py deleted file mode 100755 index 353803698b..0000000000 --- a/modules/account_dunning/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_dunning' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for account dunning', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-dunning'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - download_url=download_url, - keywords='tryton account dunning', - package_dir={'trytond.modules.account_dunning': '.'}, - packages=( - ['trytond.modules.account_dunning'] - + ['trytond.modules.account_dunning.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_dunning': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_dunning = trytond.modules.account_dunning - """, - ) diff --git a/modules/account_dunning/tox.ini b/modules/account_dunning/tox.ini index 53e3ce4cf0..4f2b19a752 100644 --- a/modules/account_dunning/tox.ini +++ b/modules/account_dunning/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_dunning --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_dunning {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_dunning_email/COPYRIGHT b/modules/account_dunning_email/COPYRIGHT index 9512eceaed..6f3a8ebb90 100644 --- a/modules/account_dunning_email/COPYRIGHT +++ b/modules/account_dunning_email/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2017-2025 Cédric Krier -Copyright (C) 2017-2025 B2CK +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_dunning_email/MANIFEST.in b/modules/account_dunning_email/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_dunning_email/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_dunning_email/doc/conf.py b/modules/account_dunning_email/doc/conf.py index 95f24ad761..ee50e0e9e1 100644 --- a/modules/account_dunning_email/doc/conf.py +++ b/modules/account_dunning_email/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_dunning_email/doc/requirements-doc.txt b/modules/account_dunning_email/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_dunning_email/doc/requirements-doc.txt +++ b/modules/account_dunning_email/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_dunning_email/pyproject.toml b/modules/account_dunning_email/pyproject.toml new file mode 100644 index 0000000000..08b4b0c445 --- /dev/null +++ b/modules/account_dunning_email/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_dunning_email' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Accounting dunning by e-mail for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "dunning", "email"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_dunning_email = 'trytond.modules.account_dunning_email' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-dunning-email/" +changelog = "https://docs.tryton.org/modules-account-dunning-email/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + '**/*.html', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_dunning_email" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_dunning_email/setup.py b/modules/account_dunning_email/setup.py deleted file mode 100755 index 783766e931..0000000000 --- a/modules/account_dunning_email/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_dunning_email' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for account dunning email', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-dunning-email'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account dunning email', - package_dir={'trytond.modules.account_dunning_email': '.'}, - packages=( - ['trytond.modules.account_dunning_email'] - + ['trytond.modules.account_dunning_email.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_dunning_email': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.html', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_dunning_email = trytond.modules.account_dunning_email - """, - ) diff --git a/modules/account_dunning_email/tox.ini b/modules/account_dunning_email/tox.ini index 53e3ce4cf0..1d5c45d493 100644 --- a/modules/account_dunning_email/tox.ini +++ b/modules/account_dunning_email/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_dunning_email --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_dunning_email {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_dunning_fee/COPYRIGHT b/modules/account_dunning_fee/COPYRIGHT index 5e97b93a9c..20cd6e00b2 100644 --- a/modules/account_dunning_fee/COPYRIGHT +++ b/modules/account_dunning_fee/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2016-2025 Cédric Krier -Copyright (C) 2016-2025 B2CK +Copyright (C) 2016-2025 Cédric Krier +Copyright (C) 2016-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_dunning_fee/MANIFEST.in b/modules/account_dunning_fee/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_dunning_fee/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_dunning_fee/doc/conf.py b/modules/account_dunning_fee/doc/conf.py index fb8d11c30c..ffdfca0b0f 100644 --- a/modules/account_dunning_fee/doc/conf.py +++ b/modules/account_dunning_fee/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_dunning_fee/doc/requirements-doc.txt b/modules/account_dunning_fee/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_dunning_fee/doc/requirements-doc.txt +++ b/modules/account_dunning_fee/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_dunning_fee/pyproject.toml b/modules/account_dunning_fee/pyproject.toml new file mode 100644 index 0000000000..e6b956c795 --- /dev/null +++ b/modules/account_dunning_fee/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_dunning_fee' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Accounting dunning fees for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "dunning", "fee"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_dunning_fee = 'trytond.modules.account_dunning_fee' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-dunning-fee/" +changelog = "https://docs.tryton.org/modules-account-dunning-fee/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_dunning_fee" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_dunning_fee/setup.py b/modules/account_dunning_fee/setup.py deleted file mode 100755 index 030161e9ff..0000000000 --- a/modules/account_dunning_fee/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_dunning_fee' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_account_dunning_letter')] - -setup(name=name, - version=version, - description='Tryton module for account dunning fee', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-dunning-fee'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='account dunning fee', - package_dir={'trytond.modules.account_dunning_fee': '.'}, - packages=( - ['trytond.modules.account_dunning_fee'] - + ['trytond.modules.account_dunning_fee.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_dunning_fee': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_dunning_fee = trytond.modules.account_dunning_fee - """, - ) diff --git a/modules/account_dunning_fee/tox.ini b/modules/account_dunning_fee/tox.ini index 53e3ce4cf0..b42f69c74a 100644 --- a/modules/account_dunning_fee/tox.ini +++ b/modules/account_dunning_fee/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_dunning_fee --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_dunning_fee {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_dunning_letter/COPYRIGHT b/modules/account_dunning_letter/COPYRIGHT index c5f9863cf1..a2d4e65b8c 100644 --- a/modules/account_dunning_letter/COPYRIGHT +++ b/modules/account_dunning_letter/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2013-2025 Cédric Krier. -Copyright (C) 2013-2025 B2CK SPRL. +Copyright (C) 2013-2025 Cédric Krier +Copyright (C) 2013-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_dunning_letter/MANIFEST.in b/modules/account_dunning_letter/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_dunning_letter/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_dunning_letter/doc/conf.py b/modules/account_dunning_letter/doc/conf.py index 720beb38b6..6833ea5fc3 100644 --- a/modules/account_dunning_letter/doc/conf.py +++ b/modules/account_dunning_letter/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_dunning_letter/doc/requirements-doc.txt b/modules/account_dunning_letter/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_dunning_letter/doc/requirements-doc.txt +++ b/modules/account_dunning_letter/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_dunning_letter/pyproject.toml b/modules/account_dunning_letter/pyproject.toml new file mode 100644 index 0000000000..55302d1c24 --- /dev/null +++ b/modules/account_dunning_letter/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_dunning_letter' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Accounting dunning by letter for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "dunning", "letter"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_dunning_letter = 'trytond.modules.account_dunning_letter' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-dunning-letter/" +changelog = "https://docs.tryton.org/modules-account-dunning-letter/release.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_dunning_letter" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_dunning_letter/setup.py b/modules/account_dunning_letter/setup.py deleted file mode 100755 index eb7702fa9a..0000000000 --- a/modules/account_dunning_letter/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_dunning_letter' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for account dunning letter', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-dunning-letter'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account dunning letter', - package_dir={'trytond.modules.account_dunning_letter': '.'}, - packages=( - ['trytond.modules.account_dunning_letter'] - + ['trytond.modules.account_dunning_letter.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_dunning_letter': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'letter.fodt', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_dunning_letter = trytond.modules.account_dunning_letter - """, - ) diff --git a/modules/account_dunning_letter/tox.ini b/modules/account_dunning_letter/tox.ini index 53e3ce4cf0..6c32067220 100644 --- a/modules/account_dunning_letter/tox.ini +++ b/modules/account_dunning_letter/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_dunning_letter --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_dunning_letter {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_es/COPYRIGHT b/modules/account_es/COPYRIGHT index adcb495180..a82b272f94 100644 --- a/modules/account_es/COPYRIGHT +++ b/modules/account_es/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2017-2023 Sergi Almacellas Abellana -Copyright (C) 2013-2016 Zikzakmedia SL. +Copyright (C) 2017-2023 Sergi Almacellas Abellana +Copyright (C) 2013-2016 Zikzakmedia SL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_es/MANIFEST.in b/modules/account_es/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_es/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_es/doc/conf.py b/modules/account_es/doc/conf.py index 8ce84f36c4..7ecef36123 100644 --- a/modules/account_es/doc/conf.py +++ b/modules/account_es/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_es/doc/requirements-doc.txt b/modules/account_es/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_es/doc/requirements-doc.txt +++ b/modules/account_es/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_es/pyproject.toml b/modules/account_es/pyproject.toml new file mode 100644 index 0000000000..61864154c9 --- /dev/null +++ b/modules/account_es/pyproject.toml @@ -0,0 +1,64 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_es' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Spanish chart of accounts for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "coa", "spanish"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_es = 'trytond.modules.account_es' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-es/" +changelog = "https://docs.tryton.org/modules-account-es/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + '*.txt', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.txt', + 'tests/**/*.csv', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_es" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql >= 1.1.0', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_es/setup.py b/modules/account_es/setup.py deleted file mode 100755 index 1953a950f9..0000000000 --- a/modules/account_es/setup.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_es' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 1.1.0'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_asset'), - get_require_version('trytond_account_payment_sepa'), - get_require_version('trytond_sale_advance_payment'), - get_require_version('trytond_sale_gift_card'), - ] - -setup(name=name, - version=version, - description='Tryton with Spanish chart of accounts', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-es/'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account chart spanish', - package_dir={'trytond.modules.account_es': '.'}, - packages=( - ['trytond.modules.account_es'] - + ['trytond.modules.account_es.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_es': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.txt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.txt', 'tests/*.csv']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Spanish', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_es = trytond.modules.account_es - """, - ) diff --git a/modules/account_es/tox.ini b/modules/account_es/tox.ini index 53e3ce4cf0..cd6025907f 100644 --- a/modules/account_es/tox.ini +++ b/modules/account_es/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_es --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_es {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_es_sii/COPYRIGHT b/modules/account_es_sii/COPYRIGHT index 05162203a1..a4ae5204d2 100644 --- a/modules/account_es_sii/COPYRIGHT +++ b/modules/account_es_sii/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2020-2025 Sergi Almacellas Abellana -Copyright (C) 2023-2025 B2CK -Copyright (C) 2023-2025 Cédric Krier +Copyright (C) 2020-2025 Sergi Almacellas Abellana +Copyright (C) 2023-2025 B2CK SRL +Copyright (C) 2023-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_es_sii/MANIFEST.in b/modules/account_es_sii/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_es_sii/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_es_sii/doc/conf.py b/modules/account_es_sii/doc/conf.py index 1208c148b3..25b7af2e92 100644 --- a/modules/account_es_sii/doc/conf.py +++ b/modules/account_es_sii/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_es_sii/doc/requirements-doc.txt b/modules/account_es_sii/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_es_sii/doc/requirements-doc.txt +++ b/modules/account_es_sii/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_es_sii/pyproject.toml b/modules/account_es_sii/pyproject.toml new file mode 100644 index 0000000000..26485183dc --- /dev/null +++ b/modules/account_es_sii/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_es_sii' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Spanish SII invoice reporting for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "invoice", "spanish", "SII"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_es_sii = 'trytond.modules.account_es_sii' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-es-sii/" +changelog = "https://docs.tryton.org/modules-account-es-sii/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_es_sii" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'requests', + 'zeep', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_es_sii/setup.py b/modules/account_es_sii/setup.py deleted file mode 100755 index fd7b9c2cf7..0000000000 --- a/modules/account_es_sii/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_es_sii' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['zeep', 'requests'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module that sends invoices to the Spanish SII ' - 'webservice', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account sii spain', - package_dir={'trytond.modules.account_es_sii': '.'}, - packages=( - ['trytond.modules.account_es_sii'] - + ['trytond.modules.account_es_sii.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_es_sii': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_es_sii = trytond.modules.account_es_sii - """, - ) diff --git a/modules/account_es_sii/tox.ini b/modules/account_es_sii/tox.ini index 53e3ce4cf0..03fe1ee079 100644 --- a/modules/account_es_sii/tox.ini +++ b/modules/account_es_sii/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_es_sii --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_es_sii {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_eu/COPYRIGHT b/modules/account_eu/COPYRIGHT index 9512eceaed..6f3a8ebb90 100644 --- a/modules/account_eu/COPYRIGHT +++ b/modules/account_eu/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2017-2025 Cédric Krier -Copyright (C) 2017-2025 B2CK +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_eu/MANIFEST.in b/modules/account_eu/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_eu/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_eu/doc/conf.py b/modules/account_eu/doc/conf.py index 003fdbcea1..7d7408c018 100644 --- a/modules/account_eu/doc/conf.py +++ b/modules/account_eu/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_eu/doc/requirements-doc.txt b/modules/account_eu/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_eu/doc/requirements-doc.txt +++ b/modules/account_eu/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_eu/pyproject.toml b/modules/account_eu/pyproject.toml new file mode 100644 index 0000000000..bd269aaebe --- /dev/null +++ b/modules/account_eu/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_eu' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "European accounting for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "europe", "vat"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_eu = 'trytond.modules.account_eu' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-eu/" +changelog = "https://docs.tryton.org/modules-account-eu/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_eu" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/account_eu/setup.py b/modules/account_eu/setup.py deleted file mode 100755 index fafb2c99dc..0000000000 --- a/modules/account_eu/setup.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_eu' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module for european accounting', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-eu'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account europe vat', - package_dir={'trytond.modules.account_eu': '.'}, - packages=( - ['trytond.modules.account_eu'] - + ['trytond.modules.account_eu.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_eu': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_eu = trytond.modules.account_eu - """, - ) diff --git a/modules/account_eu/tox.ini b/modules/account_eu/tox.ini index 53e3ce4cf0..7b0d59f71e 100644 --- a/modules/account_eu/tox.ini +++ b/modules/account_eu/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_eu --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_eu {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_export/COPYRIGHT b/modules/account_export/COPYRIGHT index b597fcb534..0501781531 100644 --- a/modules/account_export/COPYRIGHT +++ b/modules/account_export/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2024-2025 B2CK -Copyright (C) 2024-2025 Cédric Krier +Copyright (C) 2024-2025 B2CK SRL +Copyright (C) 2024-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_export/MANIFEST.in b/modules/account_export/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_export/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_export/doc/conf.py b/modules/account_export/doc/conf.py index 2dd2eeb433..372eacd830 100644 --- a/modules/account_export/doc/conf.py +++ b/modules/account_export/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_export/doc/requirements-doc.txt b/modules/account_export/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_export/doc/requirements-doc.txt +++ b/modules/account_export/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_export/pyproject.toml b/modules/account_export/pyproject.toml new file mode 100644 index 0000000000..7d31b1d1c9 --- /dev/null +++ b/modules/account_export/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_export' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Accounting export for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "export"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_export = 'trytond.modules.account_export' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-export/" +changelog = "https://docs.tryton.org/modules-account-export/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_export" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_export/setup.py b/modules/account_export/setup.py deleted file mode 100755 index 0aee3c046a..0000000000 --- a/modules/account_export/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_export' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to export accounting to other software', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/projects/modules-account-export'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account export', - package_dir={'trytond.modules.account_export': '.'}, - packages=( - ['trytond.modules.account_export'] - + ['trytond.modules.account_export.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_export': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_export = trytond.modules.account_export - """, # noqa: E501 - ) diff --git a/modules/account_export/tox.ini b/modules/account_export/tox.ini index 53e3ce4cf0..50277d9dff 100644 --- a/modules/account_export/tox.ini +++ b/modules/account_export/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_export --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_export {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_export_winbooks/COPYRIGHT b/modules/account_export_winbooks/COPYRIGHT index 643c463ffe..16456926b3 100644 --- a/modules/account_export_winbooks/COPYRIGHT +++ b/modules/account_export_winbooks/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2024-2025 Cédric Krier +Copyright (C) 2024-2025 Cédric Krier +Copyright (C) 2024-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_export_winbooks/MANIFEST.in b/modules/account_export_winbooks/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_export_winbooks/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_export_winbooks/doc/conf.py b/modules/account_export_winbooks/doc/conf.py index 010b54cddd..7c591f9ff6 100644 --- a/modules/account_export_winbooks/doc/conf.py +++ b/modules/account_export_winbooks/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_export_winbooks/doc/requirements-doc.txt b/modules/account_export_winbooks/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_export_winbooks/doc/requirements-doc.txt +++ b/modules/account_export_winbooks/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_export_winbooks/pyproject.toml b/modules/account_export_winbooks/pyproject.toml new file mode 100644 index 0000000000..69112623eb --- /dev/null +++ b/modules/account_export_winbooks/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_export_winbooks' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Accounting export to WinBooks for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "export", "winbooks"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_export_winbooks = 'trytond.modules.account_export_winbooks' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-export-winbooks/" +changelog = "https://docs.tryton.org/modules-account-export-winbooks/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.txt', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_export_winbooks" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_export_winbooks/setup.py b/modules/account_export_winbooks/setup.py deleted file mode 100755 index 9b9cd311ef..0000000000 --- a/modules/account_export_winbooks/setup.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_export_winbooks' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_be'), - get_require_version('trytond_account_statement'), - ] - -setup(name=name, - version=version, - description='Tryton module to export accounting to WinBooks', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/projects/' - 'modules-account-export-winbooks'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account export winbooks', - package_dir={'trytond.modules.account_export_winbooks': '.'}, - packages=( - ['trytond.modules.account_export_winbooks'] - + ['trytond.modules.account_export_winbooks.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_export_winbooks': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json', 'tests/*.txt']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_export_winbooks = trytond.modules.account_export_winbooks - """, # noqa: E501 - ) diff --git a/modules/account_export_winbooks/tox.ini b/modules/account_export_winbooks/tox.ini index 53e3ce4cf0..f30058c0c7 100644 --- a/modules/account_export_winbooks/tox.ini +++ b/modules/account_export_winbooks/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_export_winbooks --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_export_winbooks {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_fr/COPYRIGHT b/modules/account_fr/COPYRIGHT index d9178e7622..d5c4c47199 100644 --- a/modules/account_fr/COPYRIGHT +++ b/modules/account_fr/COPYRIGHT @@ -1,8 +1,8 @@ -Copyright (C) 2010-2025 Cédric Krier. -Copyright (C) 2010-2011 Bertrand Chenal. -Copyright (C) 2010-2024 Nicolas Évrard. -Copyright (C) 2010-2025 B2CK SPRL. -Copyright (C) 2014-2018 Raphaël Hertzog. +Copyright (C) 2010-2025 Cédric Krier +Copyright (C) 2010-2011 Bertrand Chenal +Copyright (C) 2010-2024 Nicolas Évrard +Copyright (C) 2010-2025 B2CK SRL +Copyright (C) 2014-2018 Raphaël Hertzog This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_fr/MANIFEST.in b/modules/account_fr/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_fr/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_fr/doc/conf.py b/modules/account_fr/doc/conf.py index cb206b659f..3da5e658e2 100644 --- a/modules/account_fr/doc/conf.py +++ b/modules/account_fr/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_fr/doc/requirements-doc.txt b/modules/account_fr/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_fr/doc/requirements-doc.txt +++ b/modules/account_fr/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_fr/pyproject.toml b/modules/account_fr/pyproject.toml new file mode 100644 index 0000000000..064e90a3cb --- /dev/null +++ b/modules/account_fr/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_fr' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "French chart of accounts for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "coa", "french"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_fr = 'trytond.modules.account_fr' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-fr/" +changelog = "https://docs.tryton.org/modules-account-fr/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.csv', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_fr" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_fr/setup.py b/modules/account_fr/setup.py deleted file mode 100755 index fcc5abb2c2..0000000000 --- a/modules/account_fr/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_fr' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module with French chart of accounts', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-account-fr', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account chart french fec', - package_dir={'trytond.modules.account_fr': '.'}, - packages=( - ['trytond.modules.account_fr'] - + ['trytond.modules.account_fr.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_fr': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst', - 'tests/*.csv']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_fr = trytond.modules.account_fr - """, - ) diff --git a/modules/account_fr/tox.ini b/modules/account_fr/tox.ini index 53e3ce4cf0..ad167216d3 100644 --- a/modules/account_fr/tox.ini +++ b/modules/account_fr/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_fr --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_fr {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_fr_chorus/COPYRIGHT b/modules/account_fr_chorus/COPYRIGHT index 0389249205..7fe447c110 100644 --- a/modules/account_fr_chorus/COPYRIGHT +++ b/modules/account_fr_chorus/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_fr_chorus/MANIFEST.in b/modules/account_fr_chorus/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_fr_chorus/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_fr_chorus/doc/conf.py b/modules/account_fr_chorus/doc/conf.py index 5b31b4c27b..4190bbd936 100644 --- a/modules/account_fr_chorus/doc/conf.py +++ b/modules/account_fr_chorus/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_fr_chorus/doc/requirements-doc.txt b/modules/account_fr_chorus/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_fr_chorus/doc/requirements-doc.txt +++ b/modules/account_fr_chorus/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_fr_chorus/pyproject.toml b/modules/account_fr_chorus/pyproject.toml new file mode 100644 index 0000000000..73415594fd --- /dev/null +++ b/modules/account_fr_chorus/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_fr_chorus' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Chorus Pro integration for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = [] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_fr_chorus = 'trytond.modules.account_fr_chorus' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-fr-chorus/" +changelog = "https://docs.tryton.org/modules-account-fr-chorus/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_fr_chorus" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'oauthlib', + 'python-sql', + 'requests_oauthlib', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_fr_chorus/setup.py b/modules/account_fr_chorus/setup.py deleted file mode 100755 index 7f7bd39f79..0000000000 --- a/modules/account_fr_chorus/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_fr_chorus' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql', 'requests_oauthlib', 'oauthlib'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_fr'), - get_require_version('trytond_edocument_uncefact'), - ] - -setup(name=name, - version=version, - description='Tryton module to communicate with Chorus', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-account-fr-chorus'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton chorus', - package_dir={'trytond.modules.account_fr_chorus': '.'}, - packages=( - ['trytond.modules.account_fr_chorus'] - + ['trytond.modules.account_fr_chorus.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_fr_chorus': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_fr_chorus = trytond.modules.account_fr_chorus - """, - ) diff --git a/modules/account_fr_chorus/tox.ini b/modules/account_fr_chorus/tox.ini index 53e3ce4cf0..0e3aac1321 100644 --- a/modules/account_fr_chorus/tox.ini +++ b/modules/account_fr_chorus/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_fr_chorus --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_fr_chorus {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_fr_chorus/tryton.cfg b/modules/account_fr_chorus/tryton.cfg index abbb7a080a..69264e6c3d 100644 --- a/modules/account_fr_chorus/tryton.cfg +++ b/modules/account_fr_chorus/tryton.cfg @@ -8,6 +8,7 @@ depends: party party_siret extras_depend: + account_fr edocument_uncefact xml: account.xml diff --git a/modules/account_invoice/COPYRIGHT b/modules/account_invoice/COPYRIGHT index 2babb3e0a8..e35e734acd 100644 --- a/modules/account_invoice/COPYRIGHT +++ b/modules/account_invoice/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_invoice/MANIFEST.in b/modules/account_invoice/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_invoice/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_invoice/doc/conf.py b/modules/account_invoice/doc/conf.py index 1d3faa8c1c..b2d18af8b3 100644 --- a/modules/account_invoice/doc/conf.py +++ b/modules/account_invoice/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_invoice/doc/requirements-doc.txt b/modules/account_invoice/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_invoice/doc/requirements-doc.txt +++ b/modules/account_invoice/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_invoice/pyproject.toml b/modules/account_invoice/pyproject.toml new file mode 100644 index 0000000000..a9786fe69b --- /dev/null +++ b/modules/account_invoice/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_invoice' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Invoice for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_invoice = 'trytond.modules.account_invoice' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-invoice/" +changelog = "https://docs.tryton.org/modules-account-invoice/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_invoice" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-dateutil', + 'python-sql >= 0.4', + 'python-stdnum >= 0.3', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_invoice/setup.py b/modules/account_invoice/setup.py deleted file mode 100755 index 6aae2e55fc..0000000000 --- a/modules/account_invoice/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_invoice' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-dateutil', 'python-sql >= 0.4', 'python-stdnum >= 0.3'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_bank'), - ] - -setup(name=name, - version=version, - description='Tryton module for invoicing', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": - 'https://docs.tryton.org/modules-account-invoice/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account invoice', - package_dir={'trytond.modules.account_invoice': '.'}, - packages=( - ['trytond.modules.account_invoice'] - + ['trytond.modules.account_invoice.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_invoice': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_invoice = trytond.modules.account_invoice - """, - ) diff --git a/modules/account_invoice/tox.ini b/modules/account_invoice/tox.ini index 53e3ce4cf0..aac7d49b00 100644 --- a/modules/account_invoice/tox.ini +++ b/modules/account_invoice/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_invoice --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_invoice {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_invoice_correction/COPYRIGHT b/modules/account_invoice_correction/COPYRIGHT index 3db01d1efc..64a57ed0fc 100644 --- a/modules/account_invoice_correction/COPYRIGHT +++ b/modules/account_invoice_correction/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2014-2025 Nicolas Évrard. -Copyright (C) 2014-2025 B2CK SPRL. -Copyright (C) 2016-2025 Cédric Krier +Copyright (C) 2014-2025 Nicolas Évrard +Copyright (C) 2014-2025 B2CK SRL +Copyright (C) 2016-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_invoice_correction/MANIFEST.in b/modules/account_invoice_correction/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_invoice_correction/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_invoice_correction/doc/conf.py b/modules/account_invoice_correction/doc/conf.py index b5ef06ecbe..57d7d7267d 100644 --- a/modules/account_invoice_correction/doc/conf.py +++ b/modules/account_invoice_correction/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_invoice_correction/doc/requirements-doc.txt b/modules/account_invoice_correction/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_invoice_correction/doc/requirements-doc.txt +++ b/modules/account_invoice_correction/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_invoice_correction/pyproject.toml b/modules/account_invoice_correction/pyproject.toml new file mode 100644 index 0000000000..8435eb87c9 --- /dev/null +++ b/modules/account_invoice_correction/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_invoice_correction' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Invoice correction for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_invoice_correction = 'trytond.modules.account_invoice_correction' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-invoice-correction/" +changelog = "https://docs.tryton.org/modules-account-invoice-correction/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_invoice_correction" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_invoice_correction/setup.py b/modules/account_invoice_correction/setup.py deleted file mode 100755 index c507eb9589..0000000000 --- a/modules/account_invoice_correction/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_invoice_correction' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to correct invoice', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-account-invoice-correction'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton invoice correction', - package_dir={'trytond.modules.account_invoice_correction': '.'}, - packages=( - ['trytond.modules.account_invoice_correction'] - + ['trytond.modules.account_invoice_correction.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_invoice_correction': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_invoice_correction = trytond.modules.account_invoice_correction - """, - ) diff --git a/modules/account_invoice_correction/tox.ini b/modules/account_invoice_correction/tox.ini index 53e3ce4cf0..62da9fce47 100644 --- a/modules/account_invoice_correction/tox.ini +++ b/modules/account_invoice_correction/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_invoice_correction --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_invoice_correction {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_invoice_defer/COPYRIGHT b/modules/account_invoice_defer/COPYRIGHT index bb6a8a0544..e4a7445742 100644 --- a/modules/account_invoice_defer/COPYRIGHT +++ b/modules/account_invoice_defer/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_invoice_defer/MANIFEST.in b/modules/account_invoice_defer/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_invoice_defer/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_invoice_defer/doc/conf.py b/modules/account_invoice_defer/doc/conf.py index f92ed933e4..e2ea98463f 100644 --- a/modules/account_invoice_defer/doc/conf.py +++ b/modules/account_invoice_defer/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_invoice_defer/doc/requirements-doc.txt b/modules/account_invoice_defer/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_invoice_defer/doc/requirements-doc.txt +++ b/modules/account_invoice_defer/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_invoice_defer/pyproject.toml b/modules/account_invoice_defer/pyproject.toml new file mode 100644 index 0000000000..f909d2da2d --- /dev/null +++ b/modules/account_invoice_defer/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_invoice_defer' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Defer expense and revenue for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_invoice_defer = 'trytond.modules.account_invoice_defer' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-invoice-defer/" +changelog = "https://docs.tryton.org/modules-account-invoice-defer/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_invoice_defer" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_invoice_defer/setup.py b/modules/account_invoice_defer/setup.py deleted file mode 100755 index 2d1a972ca1..0000000000 --- a/modules/account_invoice_defer/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_invoice_defer' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to defer expense and revenue', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-account-invoice-defer'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account invoice defer expense revenue', - package_dir={'trytond.modules.account_invoice_defer': '.'}, - packages=( - ['trytond.modules.account_invoice_defer'] - + ['trytond.modules.account_invoice_defer.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_invoice_defer': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_invoice_defer = trytond.modules.account_invoice_defer - """, # noqa: E501 - ) diff --git a/modules/account_invoice_defer/tox.ini b/modules/account_invoice_defer/tox.ini index 53e3ce4cf0..8dfea56e9d 100644 --- a/modules/account_invoice_defer/tox.ini +++ b/modules/account_invoice_defer/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_invoice_defer --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_invoice_defer {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_invoice_history/COPYRIGHT b/modules/account_invoice_history/COPYRIGHT index 3c933baa0c..e8c9eb806d 100644 --- a/modules/account_invoice_history/COPYRIGHT +++ b/modules/account_invoice_history/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2009-2025 Cédric Krier. -Copyright (C) 2009-2012 Bertrand Chenal. -Copyright (C) 2009-2025 B2CK SPRL. +Copyright (C) 2009-2025 Cédric Krier +Copyright (C) 2009-2012 Bertrand Chenal +Copyright (C) 2009-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_invoice_history/MANIFEST.in b/modules/account_invoice_history/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_invoice_history/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_invoice_history/doc/conf.py b/modules/account_invoice_history/doc/conf.py index c4dd445157..5589252838 100644 --- a/modules/account_invoice_history/doc/conf.py +++ b/modules/account_invoice_history/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_invoice_history/doc/requirements-doc.txt b/modules/account_invoice_history/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_invoice_history/doc/requirements-doc.txt +++ b/modules/account_invoice_history/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_invoice_history/pyproject.toml b/modules/account_invoice_history/pyproject.toml new file mode 100644 index 0000000000..c21b767437 --- /dev/null +++ b/modules/account_invoice_history/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_invoice_history' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Invoices history for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_invoice_history = 'trytond.modules.account_invoice_history' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-invoice-history/" +changelog = "https://docs.tryton.org/modules-account-invoice-history/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_invoice_history" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_invoice_history/setup.py b/modules/account_invoice_history/setup.py deleted file mode 100755 index 1e0824cc58..0000000000 --- a/modules/account_invoice_history/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_invoice_history' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to historize invoices', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-invoice-history'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account invoice history', - package_dir={'trytond.modules.account_invoice_history': '.'}, - packages=( - ['trytond.modules.account_invoice_history'] - + ['trytond.modules.account_invoice_history.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_invoice_history': (info.get('xml', []) - + ['tryton.cfg', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_invoice_history = trytond.modules.account_invoice_history - """, - ) diff --git a/modules/account_invoice_history/tox.ini b/modules/account_invoice_history/tox.ini index 53e3ce4cf0..68573c844d 100644 --- a/modules/account_invoice_history/tox.ini +++ b/modules/account_invoice_history/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_invoice_history --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_invoice_history {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_invoice_line_standalone/COPYRIGHT b/modules/account_invoice_line_standalone/COPYRIGHT index f9702c30ca..bfecfa3ea1 100644 --- a/modules/account_invoice_line_standalone/COPYRIGHT +++ b/modules/account_invoice_line_standalone/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2012 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2012 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_invoice_line_standalone/MANIFEST.in b/modules/account_invoice_line_standalone/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_invoice_line_standalone/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_invoice_line_standalone/doc/conf.py b/modules/account_invoice_line_standalone/doc/conf.py index 3d06c60896..b319d320a2 100644 --- a/modules/account_invoice_line_standalone/doc/conf.py +++ b/modules/account_invoice_line_standalone/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_invoice_line_standalone/doc/requirements-doc.txt b/modules/account_invoice_line_standalone/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_invoice_line_standalone/doc/requirements-doc.txt +++ b/modules/account_invoice_line_standalone/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_invoice_line_standalone/pyproject.toml b/modules/account_invoice_line_standalone/pyproject.toml new file mode 100644 index 0000000000..b9970e4869 --- /dev/null +++ b/modules/account_invoice_line_standalone/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_invoice_line_standalone' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Invoice line standalone for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_invoice_line_standalone = 'trytond.modules.account_invoice_line_standalone' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-invoice-line-standalone/" +changelog = "https://docs.tryton.org/modules-account-invoice-line-standalone/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_invoice_line_standalone" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/account_invoice_line_standalone/setup.py b/modules/account_invoice_line_standalone/setup.py deleted file mode 100755 index 985a9e2b83..0000000000 --- a/modules/account_invoice_line_standalone/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_invoice_line_standalone' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to have standalone invoice lines', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-account-invoice-line-standalone'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account standalone invoice line', - package_dir={'trytond.modules.account_invoice_line_standalone': '.'}, - packages=( - ['trytond.modules.account_invoice_line_standalone'] - + ['trytond.modules.account_invoice_line_standalone.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_invoice_line_standalone': ( - info.get('xml', []) + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_invoice_line_standalone = \ - trytond.modules.account_invoice_line_standalone - """, - ) diff --git a/modules/account_invoice_line_standalone/tox.ini b/modules/account_invoice_line_standalone/tox.ini index 53e3ce4cf0..fa5308971f 100644 --- a/modules/account_invoice_line_standalone/tox.ini +++ b/modules/account_invoice_line_standalone/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_invoice_line_standalone --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_invoice_line_standalone {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_invoice_secondary_unit/COPYRIGHT b/modules/account_invoice_secondary_unit/COPYRIGHT index e42fe356fc..e7dd2b7778 100644 --- a/modules/account_invoice_secondary_unit/COPYRIGHT +++ b/modules/account_invoice_secondary_unit/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2019-2025 Cédric Krier -Copyright (C) 2019-2025 B2CK +Copyright (C) 2019-2025 Cédric Krier +Copyright (C) 2019-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_invoice_secondary_unit/MANIFEST.in b/modules/account_invoice_secondary_unit/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_invoice_secondary_unit/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_invoice_secondary_unit/doc/conf.py b/modules/account_invoice_secondary_unit/doc/conf.py index 8bcd41f672..4a6f8a70ca 100644 --- a/modules/account_invoice_secondary_unit/doc/conf.py +++ b/modules/account_invoice_secondary_unit/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_invoice_secondary_unit/doc/requirements-doc.txt b/modules/account_invoice_secondary_unit/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_invoice_secondary_unit/doc/requirements-doc.txt +++ b/modules/account_invoice_secondary_unit/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_invoice_secondary_unit/pyproject.toml b/modules/account_invoice_secondary_unit/pyproject.toml new file mode 100644 index 0000000000..30f264f7f6 --- /dev/null +++ b/modules/account_invoice_secondary_unit/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_invoice_secondary_unit' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Secondary unit for invoices in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "invoice", "unit"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_invoice_secondary_unit = 'trytond.modules.account_invoice_secondary_unit' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-invoice-secondary-unit/" +changelog = "https://docs.tryton.org/modules-account-invoice-secondary-unit/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_invoice_secondary_unit" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_invoice_secondary_unit/setup.py b/modules/account_invoice_secondary_unit/setup.py deleted file mode 100755 index 4da0d291d8..0000000000 --- a/modules/account_invoice_secondary_unit/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_invoice_secondary_unit' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to add a secondary unit on invoice line', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-account-invoice-secondary-unit'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton invoice secondary unit', - package_dir={'trytond.modules.account_invoice_secondary_unit': '.'}, - packages=( - ['trytond.modules.account_invoice_secondary_unit'] - + ['trytond.modules.account_invoice_secondary_unit.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_invoice_secondary_unit': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_invoice_secondary_unit = trytond.modules.account_invoice_secondary_unit - """, # noqa: E501 - ) diff --git a/modules/account_invoice_secondary_unit/tox.ini b/modules/account_invoice_secondary_unit/tox.ini index 53e3ce4cf0..962e439996 100644 --- a/modules/account_invoice_secondary_unit/tox.ini +++ b/modules/account_invoice_secondary_unit/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_invoice_secondary_unit --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_invoice_secondary_unit {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_invoice_stock/COPYRIGHT b/modules/account_invoice_stock/COPYRIGHT index 5dc3a55ac5..ac13c671f3 100644 --- a/modules/account_invoice_stock/COPYRIGHT +++ b/modules/account_invoice_stock/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2014-2025 Cédric Krier. -Copyright (C) 2014-2025 B2CK SPRL. +Copyright (C) 2014-2025 Cédric Krier +Copyright (C) 2014-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_invoice_stock/MANIFEST.in b/modules/account_invoice_stock/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_invoice_stock/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_invoice_stock/doc/conf.py b/modules/account_invoice_stock/doc/conf.py index d0b2ee99c5..5d9f85e172 100644 --- a/modules/account_invoice_stock/doc/conf.py +++ b/modules/account_invoice_stock/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_invoice_stock/doc/requirements-doc.txt b/modules/account_invoice_stock/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_invoice_stock/doc/requirements-doc.txt +++ b/modules/account_invoice_stock/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_invoice_stock/pyproject.toml b/modules/account_invoice_stock/pyproject.toml new file mode 100644 index 0000000000..d99c88561c --- /dev/null +++ b/modules/account_invoice_stock/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_invoice_stock' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Link stock and invoice for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "stock", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_invoice_stock = 'trytond.modules.account_invoice_stock' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-invoice-stock/" +changelog = "https://docs.tryton.org/modules-account-invoice-stock/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_invoice_stock" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_invoice_stock/setup.py b/modules/account_invoice_stock/setup.py deleted file mode 100755 index 6c28130e97..0000000000 --- a/modules/account_invoice_stock/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_invoice_stock' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to link stock and invoice', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": - 'https://docs.tryton.org/modules-account-invoice-stock/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account invoice stock', - package_dir={'trytond.modules.account_invoice_stock': '.'}, - packages=( - ['trytond.modules.account_invoice_stock'] - + ['trytond.modules.account_invoice_stock.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_invoice_stock': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_invoice_stock = trytond.modules.account_invoice_stock - """, - ) diff --git a/modules/account_invoice_stock/tox.ini b/modules/account_invoice_stock/tox.ini index 53e3ce4cf0..81e5d194b5 100644 --- a/modules/account_invoice_stock/tox.ini +++ b/modules/account_invoice_stock/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_invoice_stock --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_invoice_stock {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_invoice_watermark/COPYRIGHT b/modules/account_invoice_watermark/COPYRIGHT index 523289548e..202b682dd7 100644 --- a/modules/account_invoice_watermark/COPYRIGHT +++ b/modules/account_invoice_watermark/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_invoice_watermark/MANIFEST.in b/modules/account_invoice_watermark/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_invoice_watermark/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_invoice_watermark/doc/conf.py b/modules/account_invoice_watermark/doc/conf.py index 139a745119..58bac4f539 100644 --- a/modules/account_invoice_watermark/doc/conf.py +++ b/modules/account_invoice_watermark/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_invoice_watermark/doc/requirements-doc.txt b/modules/account_invoice_watermark/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_invoice_watermark/doc/requirements-doc.txt +++ b/modules/account_invoice_watermark/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_invoice_watermark/pyproject.toml b/modules/account_invoice_watermark/pyproject.toml new file mode 100644 index 0000000000..b08eecd337 --- /dev/null +++ b/modules/account_invoice_watermark/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_invoice_watermark' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Invoice watermark for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_invoice_watermark = 'trytond.modules.account_invoice_watermark' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-invoice-watermark/" +changelog = "https://docs.tryton.org/modules-account-invoice-watermark/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_invoice_watermark" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['pypdf >= 3'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_invoice_watermark/setup.py b/modules/account_invoice_watermark/setup.py deleted file mode 100755 index 60be4cc7e0..0000000000 --- a/modules/account_invoice_watermark/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_invoice_watermark' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['pypdf >= 3'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to add watermark to invoice', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-account-invoice-watermark'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account invoice watermark', - package_dir={'trytond.modules.account_invoice_watermark': '.'}, - packages=( - ['trytond.modules.account_invoice_watermark'] - + ['trytond.modules.account_invoice_watermark.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_invoice_watermark': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_invoice_watermark = trytond.modules.account_invoice_watermark - """, # noqa: E501 - ) diff --git a/modules/account_invoice_watermark/tox.ini b/modules/account_invoice_watermark/tox.ini index 53e3ce4cf0..053733190b 100644 --- a/modules/account_invoice_watermark/tox.ini +++ b/modules/account_invoice_watermark/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_invoice_watermark --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_invoice_watermark {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_move_line_grouping/COPYRIGHT b/modules/account_move_line_grouping/COPYRIGHT index bb6a8a0544..e4a7445742 100644 --- a/modules/account_move_line_grouping/COPYRIGHT +++ b/modules/account_move_line_grouping/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_move_line_grouping/MANIFEST.in b/modules/account_move_line_grouping/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_move_line_grouping/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_move_line_grouping/doc/conf.py b/modules/account_move_line_grouping/doc/conf.py index d97feea84a..65194c5b68 100644 --- a/modules/account_move_line_grouping/doc/conf.py +++ b/modules/account_move_line_grouping/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_move_line_grouping/doc/requirements-doc.txt b/modules/account_move_line_grouping/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_move_line_grouping/doc/requirements-doc.txt +++ b/modules/account_move_line_grouping/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_move_line_grouping/pyproject.toml b/modules/account_move_line_grouping/pyproject.toml new file mode 100644 index 0000000000..3a6ef9c179 --- /dev/null +++ b/modules/account_move_line_grouping/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_move_line_grouping' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Group account move line for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_move_line_grouping = 'trytond.modules.account_move_line_grouping' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-move-line-grouping/" +changelog = "https://docs.tryton.org/modules-account-move-line-grouping/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_move_line_grouping" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_move_line_grouping/setup.py b/modules/account_move_line_grouping/setup.py deleted file mode 100755 index 082cc07e38..0000000000 --- a/modules/account_move_line_grouping/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_move_line_grouping' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to display account move line grouped', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-account-move-line-grouping'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account line group', - package_dir={'trytond.modules.account_move_line_grouping': '.'}, - packages=( - ['trytond.modules.account_move_line_grouping'] - + ['trytond.modules.account_move_line_grouping.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_move_line_grouping': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_move_line_grouping = trytond.modules.account_move_line_grouping - """, # noqa: E501 - ) diff --git a/modules/account_move_line_grouping/tox.ini b/modules/account_move_line_grouping/tox.ini index 53e3ce4cf0..89ed6637b9 100644 --- a/modules/account_move_line_grouping/tox.ini +++ b/modules/account_move_line_grouping/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_move_line_grouping --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_move_line_grouping {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_payment/COPYRIGHT b/modules/account_payment/COPYRIGHT index c5f9863cf1..a2d4e65b8c 100644 --- a/modules/account_payment/COPYRIGHT +++ b/modules/account_payment/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2013-2025 Cédric Krier. -Copyright (C) 2013-2025 B2CK SPRL. +Copyright (C) 2013-2025 Cédric Krier +Copyright (C) 2013-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_payment/MANIFEST.in b/modules/account_payment/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_payment/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_payment/doc/conf.py b/modules/account_payment/doc/conf.py index cae2d6854b..f44c3f80ad 100644 --- a/modules/account_payment/doc/conf.py +++ b/modules/account_payment/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_payment/doc/requirements-doc.txt b/modules/account_payment/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_payment/doc/requirements-doc.txt +++ b/modules/account_payment/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_payment/pyproject.toml b/modules/account_payment/pyproject.toml new file mode 100644 index 0000000000..839e186ea3 --- /dev/null +++ b/modules/account_payment/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_payment' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Payment for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "payment"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_payment = 'trytond.modules.account_payment' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-payment/" +changelog = "https://docs.tryton.org/modules-account-payment/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_payment" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_payment/setup.py b/modules/account_payment/setup.py deleted file mode 100755 index 26ff5f9a2e..0000000000 --- a/modules/account_payment/setup.py +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_payment' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_dunning'), - get_require_version('trytond_account_statement'), - get_require_version('trytond_account_statement_rule'), - ] -for dep in ['account_invoice']: - tests_require.append(get_require_version('trytond_%s' % dep)) - -setup(name=name, - version=version, - description='Tryton module for payment', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-account-payment'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account payment', - package_dir={'trytond.modules.account_payment': '.'}, - packages=( - ['trytond.modules.account_payment'] - + ['trytond.modules.account_payment.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_payment': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_payment = trytond.modules.account_payment - """, - ) diff --git a/modules/account_payment/tox.ini b/modules/account_payment/tox.ini index 53e3ce4cf0..a775e2ecb7 100644 --- a/modules/account_payment/tox.ini +++ b/modules/account_payment/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_payment --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_payment {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_payment_braintree/COPYRIGHT b/modules/account_payment_braintree/COPYRIGHT index f85dc624b4..01cea9b9c1 100644 --- a/modules/account_payment_braintree/COPYRIGHT +++ b/modules/account_payment_braintree/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2020-2025 B2CK -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL +Copyright (C) 2020-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_payment_braintree/MANIFEST.in b/modules/account_payment_braintree/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_payment_braintree/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_payment_braintree/doc/conf.py b/modules/account_payment_braintree/doc/conf.py index 5d88314368..a21f54394a 100644 --- a/modules/account_payment_braintree/doc/conf.py +++ b/modules/account_payment_braintree/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_payment_braintree/doc/requirements-doc.txt b/modules/account_payment_braintree/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_payment_braintree/doc/requirements-doc.txt +++ b/modules/account_payment_braintree/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_payment_braintree/pyproject.toml b/modules/account_payment_braintree/pyproject.toml new file mode 100644 index 0000000000..0ead75b316 --- /dev/null +++ b/modules/account_payment_braintree/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_payment_braintree' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Braintree payment for tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "payment", "braintree", "paypal"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_payment_braintree = 'trytond.modules.account_payment_braintree' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-payment-braintree/" +changelog = "https://docs.tryton.org/modules-account-payment-braintree/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + '**/*.html', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_payment_braintree" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['braintree >= 3.38.0'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_payment_braintree/setup.py b/modules/account_payment_braintree/setup.py deleted file mode 100755 index 7e012f95ad..0000000000 --- a/modules/account_payment_braintree/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_payment_braintree' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['braintree >= 3.38.0'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for Braintree payment', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-account-payment-braintree'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account payment braintree', - package_dir={'trytond.modules.account_payment_braintree': '.'}, - packages=( - ['trytond.modules.account_payment_braintree'] - + ['trytond.modules.account_payment_braintree.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_payment_braintree': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', '*.html', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_payment_braintree = trytond.modules.account_payment_braintree - """, # noqa: E501 - ) diff --git a/modules/account_payment_braintree/tox.ini b/modules/account_payment_braintree/tox.ini index 53e3ce4cf0..3c6f716d5a 100644 --- a/modules/account_payment_braintree/tox.ini +++ b/modules/account_payment_braintree/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_payment_braintree --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_payment_braintree {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_payment_clearing/COPYRIGHT b/modules/account_payment_clearing/COPYRIGHT index 5dc3a55ac5..ac13c671f3 100644 --- a/modules/account_payment_clearing/COPYRIGHT +++ b/modules/account_payment_clearing/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2014-2025 Cédric Krier. -Copyright (C) 2014-2025 B2CK SPRL. +Copyright (C) 2014-2025 Cédric Krier +Copyright (C) 2014-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_payment_clearing/MANIFEST.in b/modules/account_payment_clearing/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_payment_clearing/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_payment_clearing/doc/conf.py b/modules/account_payment_clearing/doc/conf.py index 60727b8045..5d01ae9fd7 100644 --- a/modules/account_payment_clearing/doc/conf.py +++ b/modules/account_payment_clearing/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_payment_clearing/doc/requirements-doc.txt b/modules/account_payment_clearing/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_payment_clearing/doc/requirements-doc.txt +++ b/modules/account_payment_clearing/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_payment_clearing/pyproject.toml b/modules/account_payment_clearing/pyproject.toml new file mode 100644 index 0000000000..1337e99056 --- /dev/null +++ b/modules/account_payment_clearing/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_payment_clearing' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Payment clearing for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "payment"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_payment_clearing = 'trytond.modules.account_payment_clearing' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-payment-clearing/" +changelog = "https://docs.tryton.org/modules-account-payment-clearing/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_payment_clearing" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_account_invoice', + ] diff --git a/modules/account_payment_clearing/setup.py b/modules/account_payment_clearing/setup.py deleted file mode 100755 index a29a6b31c6..0000000000 --- a/modules/account_payment_clearing/setup.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_payment_clearing' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_account_statement'), - get_require_version('trytond_account_statement_rule'), - get_require_version('trytond_account_invoice'), - ] - -setup(name=name, - version=version, - description='Tryton module for payment clearing', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-account-payment-clearing'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account payment clearing', - package_dir={'trytond.modules.account_payment_clearing': '.'}, - packages=( - ['trytond.modules.account_payment_clearing'] - + ['trytond.modules.account_payment_clearing.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_payment_clearing': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_payment_clearing = trytond.modules.account_payment_clearing - """, - ) diff --git a/modules/account_payment_clearing/tox.ini b/modules/account_payment_clearing/tox.ini index 53e3ce4cf0..24981858f5 100644 --- a/modules/account_payment_clearing/tox.ini +++ b/modules/account_payment_clearing/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_payment_clearing --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_payment_clearing {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_payment_sepa/COPYRIGHT b/modules/account_payment_sepa/COPYRIGHT index c5f9863cf1..a2d4e65b8c 100644 --- a/modules/account_payment_sepa/COPYRIGHT +++ b/modules/account_payment_sepa/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2013-2025 Cédric Krier. -Copyright (C) 2013-2025 B2CK SPRL. +Copyright (C) 2013-2025 Cédric Krier +Copyright (C) 2013-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_payment_sepa/MANIFEST.in b/modules/account_payment_sepa/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_payment_sepa/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_payment_sepa/doc/conf.py b/modules/account_payment_sepa/doc/conf.py index f9f627d860..0f99a1ebbd 100644 --- a/modules/account_payment_sepa/doc/conf.py +++ b/modules/account_payment_sepa/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_payment_sepa/doc/requirements-doc.txt b/modules/account_payment_sepa/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_payment_sepa/doc/requirements-doc.txt +++ b/modules/account_payment_sepa/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_payment_sepa/pyproject.toml b/modules/account_payment_sepa/pyproject.toml new file mode 100644 index 0000000000..bdf7fedf85 --- /dev/null +++ b/modules/account_payment_sepa/pyproject.toml @@ -0,0 +1,66 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_payment_sepa' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "SEPA payment for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "payment", "SEPA"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_payment_sepa = 'trytond.modules.account_payment_sepa' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-payment-sepa/" +changelog = "https://docs.tryton.org/modules-account-payment-sepa/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.xsd', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_payment_sepa" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'Genshi', + 'lxml', + 'python-dateutil', + 'python-stdnum >= 1.0', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_payment_sepa/setup.py b/modules/account_payment_sepa/setup.py deleted file mode 100755 index b6db65b19f..0000000000 --- a/modules/account_payment_sepa/setup.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_payment_sepa' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['Genshi', 'lxml', 'python-dateutil', 'python-stdnum >= 1.0'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_invoice'), - ] - -setup(name=name, - version=version, - description='Tryton module for SEPA payment', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-payment-sepa'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account payment SEPA', - package_dir={'trytond.modules.account_payment_sepa': '.'}, - packages=( - ['trytond.modules.account_payment_sepa'] - + ['trytond.modules.account_payment_sepa.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_payment_sepa': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'template/*.xml', - 'tests/*.xml', 'tests/*.xsd']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_payment_sepa = trytond.modules.account_payment_sepa - """, - ) diff --git a/modules/account_payment_sepa/tox.ini b/modules/account_payment_sepa/tox.ini index 53e3ce4cf0..13f7888f31 100644 --- a/modules/account_payment_sepa/tox.ini +++ b/modules/account_payment_sepa/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_payment_sepa --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_payment_sepa {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_payment_sepa_cfonb/COPYRIGHT b/modules/account_payment_sepa_cfonb/COPYRIGHT index 5dc3a55ac5..ac13c671f3 100644 --- a/modules/account_payment_sepa_cfonb/COPYRIGHT +++ b/modules/account_payment_sepa_cfonb/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2014-2025 Cédric Krier. -Copyright (C) 2014-2025 B2CK SPRL. +Copyright (C) 2014-2025 Cédric Krier +Copyright (C) 2014-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_payment_sepa_cfonb/MANIFEST.in b/modules/account_payment_sepa_cfonb/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_payment_sepa_cfonb/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_payment_sepa_cfonb/doc/conf.py b/modules/account_payment_sepa_cfonb/doc/conf.py index d3d63a89ed..4fd79e70de 100644 --- a/modules/account_payment_sepa_cfonb/doc/conf.py +++ b/modules/account_payment_sepa_cfonb/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_payment_sepa_cfonb/doc/requirements-doc.txt b/modules/account_payment_sepa_cfonb/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_payment_sepa_cfonb/doc/requirements-doc.txt +++ b/modules/account_payment_sepa_cfonb/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_payment_sepa_cfonb/pyproject.toml b/modules/account_payment_sepa_cfonb/pyproject.toml new file mode 100644 index 0000000000..72f5f874db --- /dev/null +++ b/modules/account_payment_sepa_cfonb/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_payment_sepa_cfonb' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "CFONB SEPA payment for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "payment", "SEPA", "CFONB"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_payment_sepa_cfonb = 'trytond.modules.account_payment_sepa_cfonb' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-payment-sepa-cfonb/" +changelog = "https://docs.tryton.org/modules-account-payment-sepa-cfonb/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_payment_sepa_cfonb" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'Genshi', + 'lxml', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/account_payment_sepa_cfonb/setup.py b/modules/account_payment_sepa_cfonb/setup.py deleted file mode 100755 index 08422546eb..0000000000 --- a/modules/account_payment_sepa_cfonb/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_payment_sepa_cfonb' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['Genshi', 'lxml'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module for CFONB SEPA payment', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-account-payment-sepa-cfonb'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account payment SEPA CFONB', - package_dir={'trytond.modules.account_payment_sepa_cfonb': '.'}, - packages=( - ['trytond.modules.account_payment_sepa_cfonb'] - + ['trytond.modules.account_payment_sepa_cfonb.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_payment_sepa_cfonb': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'template/*.xml']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_payment_sepa_cfonb = trytond.modules.account_payment_sepa_cfonb - """, - ) diff --git a/modules/account_payment_sepa_cfonb/tox.ini b/modules/account_payment_sepa_cfonb/tox.ini index 53e3ce4cf0..7bb2b41976 100644 --- a/modules/account_payment_sepa_cfonb/tox.ini +++ b/modules/account_payment_sepa_cfonb/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_payment_sepa_cfonb --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_payment_sepa_cfonb {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_payment_stripe/COPYRIGHT b/modules/account_payment_stripe/COPYRIGHT index 5e97b93a9c..20cd6e00b2 100644 --- a/modules/account_payment_stripe/COPYRIGHT +++ b/modules/account_payment_stripe/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2016-2025 Cédric Krier -Copyright (C) 2016-2025 B2CK +Copyright (C) 2016-2025 Cédric Krier +Copyright (C) 2016-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_payment_stripe/MANIFEST.in b/modules/account_payment_stripe/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_payment_stripe/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_payment_stripe/doc/conf.py b/modules/account_payment_stripe/doc/conf.py index 4cd44f410e..43d3bbb44b 100644 --- a/modules/account_payment_stripe/doc/conf.py +++ b/modules/account_payment_stripe/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_payment_stripe/doc/requirements-doc.txt b/modules/account_payment_stripe/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_payment_stripe/doc/requirements-doc.txt +++ b/modules/account_payment_stripe/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_payment_stripe/pyproject.toml b/modules/account_payment_stripe/pyproject.toml new file mode 100644 index 0000000000..ca4eba0215 --- /dev/null +++ b/modules/account_payment_stripe/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_payment_stripe' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Stripe payment for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "payment", "stripe"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_payment_stripe = 'trytond.modules.account_payment_stripe' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-payment-stripe/" +changelog = "https://docs.tryton.org/modules-account-payment-stripe/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + '**/*.html', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_payment_stripe" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['stripe >= 7.8.0'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_payment_stripe/setup.py b/modules/account_payment_stripe/setup.py deleted file mode 100755 index 5fad8448a8..0000000000 --- a/modules/account_payment_stripe/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_payment_stripe' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['stripe >= 7.8.0'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for Stripe payment', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-payment-stripe'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account payment stripe', - package_dir={'trytond.modules.account_payment_stripe': '.'}, - packages=( - ['trytond.modules.account_payment_stripe'] - + ['trytond.modules.account_payment_stripe.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_payment_stripe': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', '*.html', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_payment_stripe = trytond.modules.account_payment_stripe - """, - ) diff --git a/modules/account_payment_stripe/tox.ini b/modules/account_payment_stripe/tox.ini index 53e3ce4cf0..7e51310305 100644 --- a/modules/account_payment_stripe/tox.ini +++ b/modules/account_payment_stripe/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_payment_stripe --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_payment_stripe {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_product/COPYRIGHT b/modules/account_product/COPYRIGHT index 2babb3e0a8..e35e734acd 100644 --- a/modules/account_product/COPYRIGHT +++ b/modules/account_product/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_product/MANIFEST.in b/modules/account_product/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_product/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_product/doc/conf.py b/modules/account_product/doc/conf.py index 69c74a8cea..a4bbd0db8b 100644 --- a/modules/account_product/doc/conf.py +++ b/modules/account_product/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_product/doc/requirements-doc.txt b/modules/account_product/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_product/doc/requirements-doc.txt +++ b/modules/account_product/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_product/pyproject.toml b/modules/account_product/pyproject.toml new file mode 100644 index 0000000000..ec847ac1d5 --- /dev/null +++ b/modules/account_product/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_product' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Accouting for Tryton products" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_product = 'trytond.modules.account_product' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-product/" +changelog = "https://docs.tryton.org/modules-account-product/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_product" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/account_product/setup.py b/modules/account_product/setup.py deleted file mode 100755 index 175105c5fe..0000000000 --- a/modules/account_product/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_product' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('trytond_analytic_account')] - -setup(name=name, - version=version, - description='Tryton module to add accounting on product', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": - 'https://docs.tryton.org/modules-account-product/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account product', - package_dir={'trytond.modules.account_product': '.'}, - packages=( - ['trytond.modules.account_product'] - + ['trytond.modules.account_product.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_product': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_product = trytond.modules.account_product - """, - ) diff --git a/modules/account_product/tox.ini b/modules/account_product/tox.ini index 53e3ce4cf0..eb91b1118d 100644 --- a/modules/account_product/tox.ini +++ b/modules/account_product/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_product --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_product {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_receivable_rule/COPYRIGHT b/modules/account_receivable_rule/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/account_receivable_rule/COPYRIGHT +++ b/modules/account_receivable_rule/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_receivable_rule/MANIFEST.in b/modules/account_receivable_rule/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_receivable_rule/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_receivable_rule/doc/conf.py b/modules/account_receivable_rule/doc/conf.py index e6573e8f9a..c385f10644 100644 --- a/modules/account_receivable_rule/doc/conf.py +++ b/modules/account_receivable_rule/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_receivable_rule/doc/requirements-doc.txt b/modules/account_receivable_rule/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_receivable_rule/doc/requirements-doc.txt +++ b/modules/account_receivable_rule/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_receivable_rule/pyproject.toml b/modules/account_receivable_rule/pyproject.toml new file mode 100644 index 0000000000..78e8fe23e4 --- /dev/null +++ b/modules/account_receivable_rule/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_receivable_rule' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Receivable rules for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_receivable_rule = 'trytond.modules.account_receivable_rule' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-receivable-rule/" +changelog = "https://docs.tryton.org/modules-account-receivable-rule/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_receivable_rule" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_receivable_rule/setup.py b/modules/account_receivable_rule/setup.py deleted file mode 100755 index af85578dcc..0000000000 --- a/modules/account_receivable_rule/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_receivable_rule' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_statement'), - ] - -setup(name=name, - version=version, - description='Tryton module to enforce receivable rules', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-account-receivable-rule' - ), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account receivable rules', - package_dir={'trytond.modules.account_receivable_rule': '.'}, - packages=( - ['trytond.modules.account_receivable_rule'] - + ['trytond.modules.account_receivable_rule.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_receivable_rule': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_receivable_rule = trytond.modules.account_receivable_rule - """, # noqa: E501 - ) diff --git a/modules/account_receivable_rule/tox.ini b/modules/account_receivable_rule/tox.ini index 53e3ce4cf0..35e433ab08 100644 --- a/modules/account_receivable_rule/tox.ini +++ b/modules/account_receivable_rule/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_receivable_rule --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_receivable_rule {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_rule/COPYRIGHT b/modules/account_rule/COPYRIGHT index d167c16e05..e4a7445742 100644 --- a/modules/account_rule/COPYRIGHT +++ b/modules/account_rule/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2021-2025 Cédric Krier -Copyright (C) 2021-2025 B2CK +Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_rule/MANIFEST.in b/modules/account_rule/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_rule/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_rule/doc/conf.py b/modules/account_rule/doc/conf.py index 24908bc54b..da1f1706b1 100644 --- a/modules/account_rule/doc/conf.py +++ b/modules/account_rule/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_rule/doc/requirements-doc.txt b/modules/account_rule/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_rule/doc/requirements-doc.txt +++ b/modules/account_rule/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_rule/pyproject.toml b/modules/account_rule/pyproject.toml new file mode 100644 index 0000000000..6f5c16d7b4 --- /dev/null +++ b/modules/account_rule/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_rule' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Account rules for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_rule = 'trytond.modules.account_rule' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-rule/" +changelog = "https://docs.tryton.org/modules-account-rule/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_rule" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_rule/setup.py b/modules/account_rule/setup.py deleted file mode 100755 index 23f1f43923..0000000000 --- a/modules/account_rule/setup.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_rule' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_invoice'), - get_require_version('trytond_account_invoice_stock'), - get_require_version('trytond_account_stock_continental'), - get_require_version('trytond_account_stock_anglo_saxon'), - get_require_version('trytond_product'), - get_require_version('trytond_purchase'), - get_require_version('trytond_purchase_shipment_cost'), - get_require_version('trytond_sale'), - get_require_version('trytond_sale_gift_card'), - get_require_version('trytond_stock'), - get_require_version('trytond_stock_consignment'), - ] - -setup(name=name, - version=version, - description='Tryton module to change account used with rules', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-account-rule'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account rule determination tax warehouse', - package_dir={'trytond.modules.account_rule': '.'}, - packages=( - ['trytond.modules.account_rule'] - + ['trytond.modules.account_rule.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_rule': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_rule = trytond.modules.account_rule - """, # noqa: E501 - ) diff --git a/modules/account_rule/tox.ini b/modules/account_rule/tox.ini index 53e3ce4cf0..7829fbda80 100644 --- a/modules/account_rule/tox.ini +++ b/modules/account_rule/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_rule --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_rule {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_statement/COPYRIGHT b/modules/account_statement/COPYRIGHT index 2babb3e0a8..e35e734acd 100644 --- a/modules/account_statement/COPYRIGHT +++ b/modules/account_statement/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_statement/MANIFEST.in b/modules/account_statement/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_statement/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_statement/doc/conf.py b/modules/account_statement/doc/conf.py index d601dd6b76..6aee417077 100644 --- a/modules/account_statement/doc/conf.py +++ b/modules/account_statement/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_statement/doc/requirements-doc.txt b/modules/account_statement/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_statement/doc/requirements-doc.txt +++ b/modules/account_statement/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_statement/pyproject.toml b/modules/account_statement/pyproject.toml new file mode 100644 index 0000000000..703e404587 --- /dev/null +++ b/modules/account_statement/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_statement' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Account statement for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "bank"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_statement = 'trytond.modules.account_statement' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-statement/" +changelog = "https://docs.tryton.org/modules-account-statement/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_statement" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_statement/setup.py b/modules/account_statement/setup.py deleted file mode 100755 index 525eb2f3f3..0000000000 --- a/modules/account_statement/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_statement' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module with account statements', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-account-statement'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account statement', - package_dir={'trytond.modules.account_statement': '.'}, - packages=( - ['trytond.modules.account_statement'] - + ['trytond.modules.account_statement.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_statement': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst', - '*.fodt']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_statement = trytond.modules.account_statement - """, - ) diff --git a/modules/account_statement/tox.ini b/modules/account_statement/tox.ini index 53e3ce4cf0..e407c39f4f 100644 --- a/modules/account_statement/tox.ini +++ b/modules/account_statement/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_statement --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_statement {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_statement_aeb43/COPYRIGHT b/modules/account_statement_aeb43/COPYRIGHT index fca0dc640c..3f66fcd45a 100644 --- a/modules/account_statement_aeb43/COPYRIGHT +++ b/modules/account_statement_aeb43/COPYRIGHT @@ -1,4 +1,4 @@ -Copyright (C) 2018-2022 Sergi Almacellas Abellana +Copyright (C) 2018-2022 Sergi Almacellas Abellana This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_statement_aeb43/MANIFEST.in b/modules/account_statement_aeb43/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_statement_aeb43/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_statement_aeb43/doc/conf.py b/modules/account_statement_aeb43/doc/conf.py index 9ca5f6ab74..525a736dea 100644 --- a/modules/account_statement_aeb43/doc/conf.py +++ b/modules/account_statement_aeb43/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_statement_aeb43/doc/requirements-doc.txt b/modules/account_statement_aeb43/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_statement_aeb43/doc/requirements-doc.txt +++ b/modules/account_statement_aeb43/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_statement_aeb43/pyproject.toml b/modules/account_statement_aeb43/pyproject.toml new file mode 100644 index 0000000000..cb5c6835ea --- /dev/null +++ b/modules/account_statement_aeb43/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_statement_aeb43' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "AEB43 bank statement for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "bank", "aeb43"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_statement_aeb43 = 'trytond.modules.account_statement_aeb43' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-statement-aeb43/" +changelog = "https://docs.tryton.org/modules-account-statement-aeb43/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.txt', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_statement_aeb43" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['aeb43'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_statement_aeb43/setup.py b/modules/account_statement_aeb43/setup.py deleted file mode 100755 index 4d5e962f92..0000000000 --- a/modules/account_statement_aeb43/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_statement_aeb43' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['aeb43'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to import AEB43 statements', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-account-statement-aeb43'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account statement AEB 43', - package_dir={'trytond.modules.account_statement_aeb43': '.'}, - packages=( - ['trytond.modules.account_statement_aeb43'] - + ['trytond.modules.account_statement_aeb43.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_statement_aeb43': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/n43.txt']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_statement_aeb43 = trytond.modules.account_statement_aeb43 - """, - ) diff --git a/modules/account_statement_aeb43/tox.ini b/modules/account_statement_aeb43/tox.ini index 53e3ce4cf0..e07d875e96 100644 --- a/modules/account_statement_aeb43/tox.ini +++ b/modules/account_statement_aeb43/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_statement_aeb43 --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_statement_aeb43 {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_statement_coda/COPYRIGHT b/modules/account_statement_coda/COPYRIGHT index 9512eceaed..6f3a8ebb90 100644 --- a/modules/account_statement_coda/COPYRIGHT +++ b/modules/account_statement_coda/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2017-2025 Cédric Krier -Copyright (C) 2017-2025 B2CK +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_statement_coda/MANIFEST.in b/modules/account_statement_coda/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_statement_coda/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_statement_coda/doc/conf.py b/modules/account_statement_coda/doc/conf.py index 6a00730e35..65d2f4443b 100644 --- a/modules/account_statement_coda/doc/conf.py +++ b/modules/account_statement_coda/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_statement_coda/doc/requirements-doc.txt b/modules/account_statement_coda/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_statement_coda/doc/requirements-doc.txt +++ b/modules/account_statement_coda/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_statement_coda/pyproject.toml b/modules/account_statement_coda/pyproject.toml new file mode 100644 index 0000000000..1211e1f60a --- /dev/null +++ b/modules/account_statement_coda/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_statement_coda' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "CODA bank statement for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "bank", "CODA"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_statement_coda = 'trytond.modules.account_statement_coda' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-statement-coda/" +changelog = "https://docs.tryton.org/modules-account-statement-coda/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.txt', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_statement_coda" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['febelfin-coda'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_statement_coda/setup.py b/modules/account_statement_coda/setup.py deleted file mode 100755 index de7cc7e248..0000000000 --- a/modules/account_statement_coda/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_statement_coda' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['febelfin-coda'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to import CODA statements', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-statement-coda'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account statement CODA febelfin', - package_dir={'trytond.modules.account_statement_coda': '.'}, - packages=( - ['trytond.modules.account_statement_coda'] - + ['trytond.modules.account_statement_coda.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_statement_coda': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/CODA.txt']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_statement_coda = trytond.modules.account_statement_coda - """, - ) diff --git a/modules/account_statement_coda/tox.ini b/modules/account_statement_coda/tox.ini index 53e3ce4cf0..3d5bf28490 100644 --- a/modules/account_statement_coda/tox.ini +++ b/modules/account_statement_coda/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_statement_coda --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_statement_coda {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_statement_mt940/COPYRIGHT b/modules/account_statement_mt940/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/account_statement_mt940/COPYRIGHT +++ b/modules/account_statement_mt940/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_statement_mt940/MANIFEST.in b/modules/account_statement_mt940/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_statement_mt940/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_statement_mt940/doc/conf.py b/modules/account_statement_mt940/doc/conf.py index c79e3fa764..5b7be0ad77 100644 --- a/modules/account_statement_mt940/doc/conf.py +++ b/modules/account_statement_mt940/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_statement_mt940/doc/requirements-doc.txt b/modules/account_statement_mt940/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_statement_mt940/doc/requirements-doc.txt +++ b/modules/account_statement_mt940/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_statement_mt940/pyproject.toml b/modules/account_statement_mt940/pyproject.toml new file mode 100644 index 0000000000..c41be6bb48 --- /dev/null +++ b/modules/account_statement_mt940/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_statement_mt940' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "MT940 bank statement for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "bank", "MT940"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_statement_mt940 = 'trytond.modules.account_statement_mt940' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-statement-mt940/" +changelog = "https://docs.tryton.org/modules-account-statement-mt940/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.txt', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_statement_mt940" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['mt940'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_statement_mt940/setup.py b/modules/account_statement_mt940/setup.py deleted file mode 100755 index 3ea76360e8..0000000000 --- a/modules/account_statement_mt940/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_statement_mt940' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['mt940'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to import MT940 statements', - long_description=read('README.rst'), - author='Tryton', - author_email='bugs@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-account-statement-mt940'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account statement mt940', - package_dir={'trytond.modules.account_statement_mt940': '.'}, - packages=( - ['trytond.modules.account_statement_mt940'] - + ['trytond.modules.account_statement_mt940.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_statement_mt940': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/MT940.txt']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_statement_mt940 = trytond.modules.account_statement_mt940 - """, # noqa: E501 - ) diff --git a/modules/account_statement_mt940/tox.ini b/modules/account_statement_mt940/tox.ini index 53e3ce4cf0..bf1bf63127 100644 --- a/modules/account_statement_mt940/tox.ini +++ b/modules/account_statement_mt940/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_statement_mt940 --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_statement_mt940 {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_statement_ofx/COPYRIGHT b/modules/account_statement_ofx/COPYRIGHT index 3655bc4251..7fe447c110 100644 --- a/modules/account_statement_ofx/COPYRIGHT +++ b/modules/account_statement_ofx/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2018-2025 Cédric Krier -Copyright (C) 2018-2025 B2CK +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_statement_ofx/MANIFEST.in b/modules/account_statement_ofx/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_statement_ofx/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_statement_ofx/doc/conf.py b/modules/account_statement_ofx/doc/conf.py index 60eccc6f68..bbd5b9ac97 100644 --- a/modules/account_statement_ofx/doc/conf.py +++ b/modules/account_statement_ofx/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_statement_ofx/doc/requirements-doc.txt b/modules/account_statement_ofx/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_statement_ofx/doc/requirements-doc.txt +++ b/modules/account_statement_ofx/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_statement_ofx/pyproject.toml b/modules/account_statement_ofx/pyproject.toml new file mode 100644 index 0000000000..12d86e9e68 --- /dev/null +++ b/modules/account_statement_ofx/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_statement_ofx' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "OFX bank statement for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "bank", "OFX"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_statement_ofx = 'trytond.modules.account_statement_ofx' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-statement-ofx/" +changelog = "https://docs.tryton.org/modules-account-statement-ofx/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.txt', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_statement_ofx" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['ofxparse'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_statement_ofx/setup.py b/modules/account_statement_ofx/setup.py deleted file mode 100755 index d46963722e..0000000000 --- a/modules/account_statement_ofx/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_statement_ofx' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['ofxparse'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to import OFX statements', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-statement-ofx'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account statement OFX QFX', - package_dir={'trytond.modules.account_statement_ofx': '.'}, - packages=( - ['trytond.modules.account_statement_ofx'] - + ['trytond.modules.account_statement_ofx.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_statement_ofx': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/OFX.txt']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_statement_ofx = trytond.modules.account_statement_ofx - """, - ) diff --git a/modules/account_statement_ofx/tox.ini b/modules/account_statement_ofx/tox.ini index 53e3ce4cf0..449c917c7b 100644 --- a/modules/account_statement_ofx/tox.ini +++ b/modules/account_statement_ofx/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_statement_ofx --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_statement_ofx {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_statement_rule/COPYRIGHT b/modules/account_statement_rule/COPYRIGHT index 0389249205..7fe447c110 100644 --- a/modules/account_statement_rule/COPYRIGHT +++ b/modules/account_statement_rule/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_statement_rule/MANIFEST.in b/modules/account_statement_rule/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_statement_rule/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_statement_rule/doc/conf.py b/modules/account_statement_rule/doc/conf.py index 60a54134c3..dd52f7e270 100644 --- a/modules/account_statement_rule/doc/conf.py +++ b/modules/account_statement_rule/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_statement_rule/doc/requirements-doc.txt b/modules/account_statement_rule/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_statement_rule/doc/requirements-doc.txt +++ b/modules/account_statement_rule/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_statement_rule/pyproject.toml b/modules/account_statement_rule/pyproject.toml new file mode 100644 index 0000000000..3b3172529a --- /dev/null +++ b/modules/account_statement_rule/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_statement_rule' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Account statement rules for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "bank"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_statement_rule = 'trytond.modules.account_statement_rule' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-statement-rule/" +changelog = "https://docs.tryton.org/modules-account-statement-rule/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_statement_rule" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-stdnum', + 'simpleeval', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_statement_rule/setup.py b/modules/account_statement_rule/setup.py deleted file mode 100755 index 4ef87c9f36..0000000000 --- a/modules/account_statement_rule/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_statement_rule' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['simpleeval', 'python-stdnum'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_bank'), - ] - -setup(name=name, - version=version, - description='Tryton module to automate statement import with rules', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-statement-rule'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton statement import rule', - package_dir={'trytond.modules.account_statement_rule': '.'}, - packages=( - ['trytond.modules.account_statement_rule'] - + ['trytond.modules.account_statement_rule.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_statement_rule': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_statement_rule = trytond.modules.account_statement_rule - """, - ) diff --git a/modules/account_statement_rule/tox.ini b/modules/account_statement_rule/tox.ini index 53e3ce4cf0..e871e20cdb 100644 --- a/modules/account_statement_rule/tox.ini +++ b/modules/account_statement_rule/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_statement_rule --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_statement_rule {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_statement_sepa/COPYRIGHT b/modules/account_statement_sepa/COPYRIGHT index b3aeb455a8..9a8a8307de 100644 --- a/modules/account_statement_sepa/COPYRIGHT +++ b/modules/account_statement_sepa/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2015-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier -Copyright (C) 2015-2023 Nicolas Évrard +Copyright (C) 2015-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2015-2023 Nicolas Évrard This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_statement_sepa/MANIFEST.in b/modules/account_statement_sepa/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_statement_sepa/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_statement_sepa/doc/conf.py b/modules/account_statement_sepa/doc/conf.py index 27930e26e8..2ffa9e8545 100644 --- a/modules/account_statement_sepa/doc/conf.py +++ b/modules/account_statement_sepa/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_statement_sepa/doc/requirements-doc.txt b/modules/account_statement_sepa/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_statement_sepa/doc/requirements-doc.txt +++ b/modules/account_statement_sepa/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_statement_sepa/pyproject.toml b/modules/account_statement_sepa/pyproject.toml new file mode 100644 index 0000000000..5e577fad72 --- /dev/null +++ b/modules/account_statement_sepa/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_statement_sepa' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "SEPA bank statement for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "bank", "SEPA"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_statement_sepa = 'trytond.modules.account_statement_sepa' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-statement-sepa/" +changelog = "https://docs.tryton.org/modules-account-statement-sepa/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.xml', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_statement_sepa" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['lxml'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_statement_sepa/setup.py b/modules/account_statement_sepa/setup.py deleted file mode 100755 index 505d69ef6e..0000000000 --- a/modules/account_statement_sepa/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_statement_sepa' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['lxml'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to import SEPA statements', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-account-statement-sepa'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account statement SEPA CAMT.052 CAMT.053 CAMT.054', - package_dir={'trytond.modules.account_statement_sepa': '.'}, - packages=( - ['trytond.modules.account_statement_sepa'] - + ['trytond.modules.account_statement_sepa.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_statement_sepa': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.xml']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_statement_sepa = trytond.modules.account_statement_sepa - """, # noqa: E501 - ) diff --git a/modules/account_statement_sepa/tox.ini b/modules/account_statement_sepa/tox.ini index 53e3ce4cf0..e3634577fe 100644 --- a/modules/account_statement_sepa/tox.ini +++ b/modules/account_statement_sepa/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_statement_sepa --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_statement_sepa {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_stock_anglo_saxon/COPYRIGHT b/modules/account_stock_anglo_saxon/COPYRIGHT index 9b45e3da1a..4f27251cac 100644 --- a/modules/account_stock_anglo_saxon/COPYRIGHT +++ b/modules/account_stock_anglo_saxon/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2010-2025 Cédric Krier. -Copyright (C) 2010-2025 B2CK SPRL. +Copyright (C) 2010-2025 Cédric Krier +Copyright (C) 2010-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_stock_anglo_saxon/MANIFEST.in b/modules/account_stock_anglo_saxon/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_stock_anglo_saxon/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_stock_anglo_saxon/doc/conf.py b/modules/account_stock_anglo_saxon/doc/conf.py index 4496d15fc4..6a6b43bc4e 100644 --- a/modules/account_stock_anglo_saxon/doc/conf.py +++ b/modules/account_stock_anglo_saxon/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_stock_anglo_saxon/doc/requirements-doc.txt b/modules/account_stock_anglo_saxon/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_stock_anglo_saxon/doc/requirements-doc.txt +++ b/modules/account_stock_anglo_saxon/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_stock_anglo_saxon/pyproject.toml b/modules/account_stock_anglo_saxon/pyproject.toml new file mode 100644 index 0000000000..437904c261 --- /dev/null +++ b/modules/account_stock_anglo_saxon/pyproject.toml @@ -0,0 +1,65 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_stock_anglo_saxon' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Real-time Anglo-Saxon stock valuation for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_stock_anglo_saxon = 'trytond.modules.account_stock_anglo_saxon' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-stock-anglo-saxon/" +changelog = "https://docs.tryton.org/modules-account-stock-anglo-saxon/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_stock_anglo_saxon" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_purchase', + 'trytond_sale', + 'trytond_sale_supply_drop_shipment', + ] diff --git a/modules/account_stock_anglo_saxon/setup.py b/modules/account_stock_anglo_saxon/setup.py deleted file mode 100755 index 8e1aa21e61..0000000000 --- a/modules/account_stock_anglo_saxon/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_stock_anglo_saxon' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_sale_supply_drop_shipment'), - get_require_version('trytond_sale'), - get_require_version('trytond_purchase')] - -setup(name=name, - version=version, - description='Tryton module for anglo-saxon real-time stock valuation', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-account-stock-anglo-saxon'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account stock valuation anglo-saxon', - package_dir={'trytond.modules.account_stock_anglo_saxon': '.'}, - packages=( - ['trytond.modules.account_stock_anglo_saxon'] - + ['trytond.modules.account_stock_anglo_saxon.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_stock_anglo_saxon': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_stock_anglo_saxon = trytond.modules.account_stock_anglo_saxon - """, - ) diff --git a/modules/account_stock_anglo_saxon/tox.ini b/modules/account_stock_anglo_saxon/tox.ini index 53e3ce4cf0..8c3d7a6466 100644 --- a/modules/account_stock_anglo_saxon/tox.ini +++ b/modules/account_stock_anglo_saxon/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_stock_anglo_saxon --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_stock_anglo_saxon {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_stock_continental/COPYRIGHT b/modules/account_stock_continental/COPYRIGHT index 9b45e3da1a..4f27251cac 100644 --- a/modules/account_stock_continental/COPYRIGHT +++ b/modules/account_stock_continental/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2010-2025 Cédric Krier. -Copyright (C) 2010-2025 B2CK SPRL. +Copyright (C) 2010-2025 Cédric Krier +Copyright (C) 2010-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_stock_continental/MANIFEST.in b/modules/account_stock_continental/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_stock_continental/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_stock_continental/doc/conf.py b/modules/account_stock_continental/doc/conf.py index 122424794c..5e06c30dcf 100644 --- a/modules/account_stock_continental/doc/conf.py +++ b/modules/account_stock_continental/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_stock_continental/doc/requirements-doc.txt b/modules/account_stock_continental/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_stock_continental/doc/requirements-doc.txt +++ b/modules/account_stock_continental/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_stock_continental/pyproject.toml b/modules/account_stock_continental/pyproject.toml new file mode 100644 index 0000000000..53c4dcd787 --- /dev/null +++ b/modules/account_stock_continental/pyproject.toml @@ -0,0 +1,66 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_stock_continental' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Real-time continental stock valuation for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_stock_continental = 'trytond.modules.account_stock_continental' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-stock-continental/" +changelog = "https://docs.tryton.org/modules-account-stock-continental/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_stock_continental" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_account_invoice', + 'trytond_purchase', + 'trytond_sale', + 'trytond_sale_supply_drop_shipment', + ] diff --git a/modules/account_stock_continental/setup.py b/modules/account_stock_continental/setup.py deleted file mode 100755 index 7f10eea89e..0000000000 --- a/modules/account_stock_continental/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_stock_continental' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] -for dep in ['sale', 'purchase', 'account_invoice', - 'sale_supply_drop_shipment']: - tests_require.append(get_require_version('trytond_%s' % dep)) - -setup(name=name, - version=version, - description='Tryton module for continental real-time stock valuation', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-account-stock-continental'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account stock valuation continental', - package_dir={'trytond.modules.account_stock_continental': '.'}, - packages=( - ['trytond.modules.account_stock_continental'] - + ['trytond.modules.account_stock_continental.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_stock_continental': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_stock_continental = trytond.modules.account_stock_continental - """, - ) diff --git a/modules/account_stock_continental/tox.ini b/modules/account_stock_continental/tox.ini index 53e3ce4cf0..2741760539 100644 --- a/modules/account_stock_continental/tox.ini +++ b/modules/account_stock_continental/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_stock_continental --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_stock_continental {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_stock_eu/COPYRIGHT b/modules/account_stock_eu/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/account_stock_eu/COPYRIGHT +++ b/modules/account_stock_eu/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_stock_eu/MANIFEST.in b/modules/account_stock_eu/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_stock_eu/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_stock_eu/doc/conf.py b/modules/account_stock_eu/doc/conf.py index 93d2db2abb..cdd648350b 100644 --- a/modules/account_stock_eu/doc/conf.py +++ b/modules/account_stock_eu/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_stock_eu/doc/requirements-doc.txt b/modules/account_stock_eu/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_stock_eu/doc/requirements-doc.txt +++ b/modules/account_stock_eu/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_stock_eu/pyproject.toml b/modules/account_stock_eu/pyproject.toml new file mode 100644 index 0000000000..7a11255b9b --- /dev/null +++ b/modules/account_stock_eu/pyproject.toml @@ -0,0 +1,65 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_stock_eu' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "European stock accounting for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "stock", "european", "intrastat"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_stock_eu = 'trytond.modules.account_stock_eu' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-stock-eu/" +changelog = "https://docs.tryton.org/modules-account-stock-eu/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_stock_eu" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_purchase_shipment_cost', + 'trytond_stock_package_shipping', + 'trytond_stock_shipment_cost', + ] diff --git a/modules/account_stock_eu/setup.py b/modules/account_stock_eu/setup.py deleted file mode 100755 index c49c2f6379..0000000000 --- a/modules/account_stock_eu/setup.py +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_stock_eu' - -download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_carrier'), - get_require_version('trytond_incoterm'), - get_require_version('trytond_production'), - get_require_version('trytond_purchase_shipment_cost'), - get_require_version('trytond_stock_consignment'), - get_require_version('trytond_stock_package_shipping'), - get_require_version('trytond_stock_shipment_cost'), - ] - -setup(name=name, - version=version, - description='Tryton module for european stock accounting', - long_description=read('README.rst'), - author='Tryton', - author_email='bugs@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-account-stock-eu'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account stock europe intrastat', - package_dir={'trytond.modules.account_stock_eu': '.'}, - packages=( - ['trytond.modules.account_stock_eu'] - + ['trytond.modules.account_stock_eu.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_stock_eu': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_stock_eu = trytond.modules.account_stock_eu - """, # noqa: E501 - ) diff --git a/modules/account_stock_eu/tox.ini b/modules/account_stock_eu/tox.ini index 53e3ce4cf0..2505e69c93 100644 --- a/modules/account_stock_eu/tox.ini +++ b/modules/account_stock_eu/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_stock_eu --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_stock_eu {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_stock_landed_cost/COPYRIGHT b/modules/account_stock_landed_cost/COPYRIGHT index 027b10a997..6c34774f53 100644 --- a/modules/account_stock_landed_cost/COPYRIGHT +++ b/modules/account_stock_landed_cost/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_stock_landed_cost/MANIFEST.in b/modules/account_stock_landed_cost/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_stock_landed_cost/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_stock_landed_cost/doc/conf.py b/modules/account_stock_landed_cost/doc/conf.py index a4831c8cfe..56908bc4fe 100644 --- a/modules/account_stock_landed_cost/doc/conf.py +++ b/modules/account_stock_landed_cost/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_stock_landed_cost/doc/requirements-doc.txt b/modules/account_stock_landed_cost/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_stock_landed_cost/doc/requirements-doc.txt +++ b/modules/account_stock_landed_cost/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_stock_landed_cost/pyproject.toml b/modules/account_stock_landed_cost/pyproject.toml new file mode 100644 index 0000000000..1f50ad3908 --- /dev/null +++ b/modules/account_stock_landed_cost/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_stock_landed_cost' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Landed cost for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_stock_landed_cost = 'trytond.modules.account_stock_landed_cost' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-stock-landed-cost/" +changelog = "https://docs.tryton.org/modules-account-stock-landed-cost/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_stock_landed_cost" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_stock_landed_cost/setup.py b/modules/account_stock_landed_cost/setup.py deleted file mode 100755 index 85604b1723..0000000000 --- a/modules/account_stock_landed_cost/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_stock_landed_cost' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for landed cost', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-account-stock-landed-cost'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account stock valuation landed cost', - package_dir={'trytond.modules.account_stock_landed_cost': '.'}, - packages=( - ['trytond.modules.account_stock_landed_cost'] - + ['trytond.modules.account_stock_landed_cost.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_stock_landed_cost': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_stock_landed_cost = trytond.modules.account_stock_landed_cost - """, - ) diff --git a/modules/account_stock_landed_cost/tox.ini b/modules/account_stock_landed_cost/tox.ini index 53e3ce4cf0..2e9a1f2fde 100644 --- a/modules/account_stock_landed_cost/tox.ini +++ b/modules/account_stock_landed_cost/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_stock_landed_cost --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_stock_landed_cost {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_stock_landed_cost_weight/COPYRIGHT b/modules/account_stock_landed_cost_weight/COPYRIGHT index 027b10a997..6c34774f53 100644 --- a/modules/account_stock_landed_cost_weight/COPYRIGHT +++ b/modules/account_stock_landed_cost_weight/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_stock_landed_cost_weight/MANIFEST.in b/modules/account_stock_landed_cost_weight/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_stock_landed_cost_weight/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_stock_landed_cost_weight/doc/conf.py b/modules/account_stock_landed_cost_weight/doc/conf.py index e99257935c..316777a74d 100644 --- a/modules/account_stock_landed_cost_weight/doc/conf.py +++ b/modules/account_stock_landed_cost_weight/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_stock_landed_cost_weight/doc/requirements-doc.txt b/modules/account_stock_landed_cost_weight/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_stock_landed_cost_weight/doc/requirements-doc.txt +++ b/modules/account_stock_landed_cost_weight/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_stock_landed_cost_weight/pyproject.toml b/modules/account_stock_landed_cost_weight/pyproject.toml new file mode 100644 index 0000000000..3d162530a5 --- /dev/null +++ b/modules/account_stock_landed_cost_weight/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_stock_landed_cost_weight' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Landed cost per weight for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_stock_landed_cost_weight = 'trytond.modules.account_stock_landed_cost_weight' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-stock-landed-cost-weight/" +changelog = "https://docs.tryton.org/modules-account-stock-landed-cost-weight/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_stock_landed_cost_weight" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_stock_landed_cost_weight/setup.py b/modules/account_stock_landed_cost_weight/setup.py deleted file mode 100755 index b571a51894..0000000000 --- a/modules/account_stock_landed_cost_weight/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_stock_landed_cost_weight' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for landed cost per weight', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-account-stock-landed-cost-weight'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account stock valuation landed cost weight', - package_dir={'trytond.modules.account_stock_landed_cost_weight': '.'}, - packages=( - ['trytond.modules.account_stock_landed_cost_weight'] - + ['trytond.modules.account_stock_landed_cost_weight.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_stock_landed_cost_weight': ( - info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_stock_landed_cost_weight = trytond.modules.account_stock_landed_cost_weight - """, # noqa: E501 - ) diff --git a/modules/account_stock_landed_cost_weight/tox.ini b/modules/account_stock_landed_cost_weight/tox.ini index 53e3ce4cf0..c867436eb4 100644 --- a/modules/account_stock_landed_cost_weight/tox.ini +++ b/modules/account_stock_landed_cost_weight/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_stock_landed_cost_weight --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_stock_landed_cost_weight {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_stock_shipment_cost/COPYRIGHT b/modules/account_stock_shipment_cost/COPYRIGHT index 523289548e..202b682dd7 100644 --- a/modules/account_stock_shipment_cost/COPYRIGHT +++ b/modules/account_stock_shipment_cost/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_stock_shipment_cost/MANIFEST.in b/modules/account_stock_shipment_cost/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_stock_shipment_cost/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_stock_shipment_cost/doc/conf.py b/modules/account_stock_shipment_cost/doc/conf.py index a469cde7bf..4c785a570d 100644 --- a/modules/account_stock_shipment_cost/doc/conf.py +++ b/modules/account_stock_shipment_cost/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_stock_shipment_cost/doc/requirements-doc.txt b/modules/account_stock_shipment_cost/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_stock_shipment_cost/doc/requirements-doc.txt +++ b/modules/account_stock_shipment_cost/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_stock_shipment_cost/pyproject.toml b/modules/account_stock_shipment_cost/pyproject.toml new file mode 100644 index 0000000000..c21a0f79de --- /dev/null +++ b/modules/account_stock_shipment_cost/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_stock_shipment_cost' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shipment cost allocation for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_stock_shipment_cost = 'trytond.modules.account_stock_shipment_cost' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-stock-shipment-cost/" +changelog = "https://docs.tryton.org/modules-account-stock-shipment-cost/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_stock_shipment_cost" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_stock_shipment_cost/setup.py b/modules/account_stock_shipment_cost/setup.py deleted file mode 100755 index ff73531278..0000000000 --- a/modules/account_stock_shipment_cost/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_stock_shipment_cost' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to allocate shipment cost based on invoice', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-account-stock-shipment-cost'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account stock shipment cost carrier invoice', - package_dir={'trytond.modules.account_stock_shipment_cost': '.'}, - packages=( - ['trytond.modules.account_stock_shipment_cost'] - + ['trytond.modules.account_stock_shipment_cost.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_stock_shipment_cost': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_stock_shipment_cost = trytond.modules.account_stock_shipment_cost - """, # noqa: E501 - ) diff --git a/modules/account_stock_shipment_cost/tox.ini b/modules/account_stock_shipment_cost/tox.ini index 53e3ce4cf0..058cc16da7 100644 --- a/modules/account_stock_shipment_cost/tox.ini +++ b/modules/account_stock_shipment_cost/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_stock_shipment_cost --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_stock_shipment_cost {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_stock_shipment_cost_weight/COPYRIGHT b/modules/account_stock_shipment_cost_weight/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/account_stock_shipment_cost_weight/COPYRIGHT +++ b/modules/account_stock_shipment_cost_weight/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_stock_shipment_cost_weight/MANIFEST.in b/modules/account_stock_shipment_cost_weight/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_stock_shipment_cost_weight/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_stock_shipment_cost_weight/doc/conf.py b/modules/account_stock_shipment_cost_weight/doc/conf.py index 830f0f9caf..727f4a8313 100644 --- a/modules/account_stock_shipment_cost_weight/doc/conf.py +++ b/modules/account_stock_shipment_cost_weight/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_stock_shipment_cost_weight/doc/requirements-doc.txt b/modules/account_stock_shipment_cost_weight/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_stock_shipment_cost_weight/doc/requirements-doc.txt +++ b/modules/account_stock_shipment_cost_weight/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_stock_shipment_cost_weight/pyproject.toml b/modules/account_stock_shipment_cost_weight/pyproject.toml new file mode 100644 index 0000000000..3901d04d14 --- /dev/null +++ b/modules/account_stock_shipment_cost_weight/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_stock_shipment_cost_weight' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shipment cost allocation per weight for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_stock_shipment_cost_weight = 'trytond.modules.account_stock_shipment_cost_weight' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-stock-shipment-cost-weight/" +changelog = "https://docs.tryton.org/modules-account-stock-shipment-cost-weight/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_stock_shipment_cost_weight" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_stock_shipment_cost_weight/setup.py b/modules/account_stock_shipment_cost_weight/setup.py deleted file mode 100755 index 884aeae65a..0000000000 --- a/modules/account_stock_shipment_cost_weight/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_stock_shipment_cost_weight' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to allocate shipment cost per weight', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-account-stock-shipment-cost-weight'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account stock shipment cost carrier weight', - package_dir={'trytond.modules.account_stock_shipment_cost_weight': '.'}, - packages=( - ['trytond.modules.account_stock_shipment_cost_weight'] - + ['trytond.modules.account_stock_shipment_cost_weight.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_stock_shipment_cost_weight': ( - info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_stock_shipment_cost_weight = trytond.modules.account_stock_shipment_cost_weight - """, # noqa: E501 - ) diff --git a/modules/account_stock_shipment_cost_weight/tox.ini b/modules/account_stock_shipment_cost_weight/tox.ini index 53e3ce4cf0..bae8d95b80 100644 --- a/modules/account_stock_shipment_cost_weight/tox.ini +++ b/modules/account_stock_shipment_cost_weight/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_stock_shipment_cost_weight --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_stock_shipment_cost_weight {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_syscohada/COPYRIGHT b/modules/account_syscohada/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/account_syscohada/COPYRIGHT +++ b/modules/account_syscohada/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_syscohada/MANIFEST.in b/modules/account_syscohada/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_syscohada/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_syscohada/doc/conf.py b/modules/account_syscohada/doc/conf.py index 4cfea184a3..5045c01abf 100644 --- a/modules/account_syscohada/doc/conf.py +++ b/modules/account_syscohada/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_syscohada/doc/requirements-doc.txt b/modules/account_syscohada/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_syscohada/doc/requirements-doc.txt +++ b/modules/account_syscohada/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_syscohada/pyproject.toml b/modules/account_syscohada/pyproject.toml new file mode 100644 index 0000000000..b1fa8af912 --- /dev/null +++ b/modules/account_syscohada/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_syscohada' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "SYSCOHADA chart of accounts for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "coa", "SYSCOHADA"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_syscohada = 'trytond.modules.account_syscohada' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-syscohada/" +changelog = "https://docs.tryton.org/modules-account-syscohada/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_syscohada" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/account_syscohada/setup.py b/modules/account_syscohada/setup.py deleted file mode 100755 index 011ea2b0a9..0000000000 --- a/modules/account_syscohada/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_syscohada' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module with SYSCOHADA chart of accounts', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/projects/modules-account-syscohada'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account chart SYSCOHADA OHADA', - package_dir={'trytond.modules.account_syscohada': '.'}, - packages=( - ['trytond.modules.account_syscohada'] - + ['trytond.modules.account_syscohada.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_syscohada': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_syscohada = trytond.modules.account_syscohada - """, # noqa: E501 - ) diff --git a/modules/account_syscohada/tox.ini b/modules/account_syscohada/tox.ini index 53e3ce4cf0..957b40e5cd 100644 --- a/modules/account_syscohada/tox.ini +++ b/modules/account_syscohada/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_syscohada --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_syscohada {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_tax_cash/COPYRIGHT b/modules/account_tax_cash/COPYRIGHT index 3655bc4251..7fe447c110 100644 --- a/modules/account_tax_cash/COPYRIGHT +++ b/modules/account_tax_cash/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2018-2025 Cédric Krier -Copyright (C) 2018-2025 B2CK +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_tax_cash/MANIFEST.in b/modules/account_tax_cash/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_tax_cash/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_tax_cash/doc/conf.py b/modules/account_tax_cash/doc/conf.py index 031c9911eb..7952303e05 100644 --- a/modules/account_tax_cash/doc/conf.py +++ b/modules/account_tax_cash/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_tax_cash/doc/requirements-doc.txt b/modules/account_tax_cash/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_tax_cash/doc/requirements-doc.txt +++ b/modules/account_tax_cash/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_tax_cash/pyproject.toml b/modules/account_tax_cash/pyproject.toml new file mode 100644 index 0000000000..35343f7bf9 --- /dev/null +++ b/modules/account_tax_cash/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_tax_cash' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Tax report on cash basis for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_tax_cash = 'trytond.modules.account_tax_cash' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-tax-cash/" +changelog = "https://docs.tryton.org/modules-account-tax-cash/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_tax_cash" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_tax_cash/setup.py b/modules/account_tax_cash/setup.py deleted file mode 100755 index c78669dbda..0000000000 --- a/modules/account_tax_cash/setup.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_tax_cash' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to support tax report on cash basis', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-tax-cash'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account tax cash', - package_dir={'trytond.modules.account_tax_cash': '.'}, - packages=( - ['trytond.modules.account_tax_cash'] - + ['trytond.modules.account_tax_cash.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_tax_cash': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_tax_cash = trytond.modules.account_tax_cash - """, - ) diff --git a/modules/account_tax_cash/tox.ini b/modules/account_tax_cash/tox.ini index 53e3ce4cf0..2b2b5ad985 100644 --- a/modules/account_tax_cash/tox.ini +++ b/modules/account_tax_cash/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_tax_cash --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_tax_cash {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_tax_non_deductible/COPYRIGHT b/modules/account_tax_non_deductible/COPYRIGHT index 523289548e..202b682dd7 100644 --- a/modules/account_tax_non_deductible/COPYRIGHT +++ b/modules/account_tax_non_deductible/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_tax_non_deductible/MANIFEST.in b/modules/account_tax_non_deductible/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_tax_non_deductible/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_tax_non_deductible/doc/conf.py b/modules/account_tax_non_deductible/doc/conf.py index 4a0c582c72..8168f8024f 100644 --- a/modules/account_tax_non_deductible/doc/conf.py +++ b/modules/account_tax_non_deductible/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_tax_non_deductible/doc/requirements-doc.txt b/modules/account_tax_non_deductible/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_tax_non_deductible/doc/requirements-doc.txt +++ b/modules/account_tax_non_deductible/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_tax_non_deductible/pyproject.toml b/modules/account_tax_non_deductible/pyproject.toml new file mode 100644 index 0000000000..9e1308de90 --- /dev/null +++ b/modules/account_tax_non_deductible/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_tax_non_deductible' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Non-deductible taxes for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_tax_non_deductible = 'trytond.modules.account_tax_non_deductible' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-tax-non-deductible/" +changelog = "https://docs.tryton.org/modules-account-tax-non-deductible/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_tax_non_deductible" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/account_tax_non_deductible/setup.py b/modules/account_tax_non_deductible/setup.py deleted file mode 100755 index eaef4a85cc..0000000000 --- a/modules/account_tax_non_deductible/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_tax_non_deductible' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to report non-deductible tax', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-account-tax-non-deductible'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account tax non-deductible', - package_dir={'trytond.modules.account_tax_non_deductible': '.'}, - packages=( - ['trytond.modules.account_tax_non_deductible'] - + ['trytond.modules.account_tax_non_deductible.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_tax_non_deductible': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_tax_non_deductible = trytond.modules.account_tax_non_deductible - """, # noqa: E501 - ) diff --git a/modules/account_tax_non_deductible/tox.ini b/modules/account_tax_non_deductible/tox.ini index 53e3ce4cf0..a927c9e8fa 100644 --- a/modules/account_tax_non_deductible/tox.ini +++ b/modules/account_tax_non_deductible/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_tax_non_deductible --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_tax_non_deductible {posargs} commands_post = coverage report coverage xml diff --git a/modules/account_tax_rule_country/COPYRIGHT b/modules/account_tax_rule_country/COPYRIGHT index 5dc3a55ac5..ac13c671f3 100644 --- a/modules/account_tax_rule_country/COPYRIGHT +++ b/modules/account_tax_rule_country/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2014-2025 Cédric Krier. -Copyright (C) 2014-2025 B2CK SPRL. +Copyright (C) 2014-2025 Cédric Krier +Copyright (C) 2014-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/account_tax_rule_country/MANIFEST.in b/modules/account_tax_rule_country/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/account_tax_rule_country/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/account_tax_rule_country/doc/conf.py b/modules/account_tax_rule_country/doc/conf.py index 4806a013be..8fb5eb46fe 100644 --- a/modules/account_tax_rule_country/doc/conf.py +++ b/modules/account_tax_rule_country/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/account_tax_rule_country/doc/requirements-doc.txt b/modules/account_tax_rule_country/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/account_tax_rule_country/doc/requirements-doc.txt +++ b/modules/account_tax_rule_country/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/account_tax_rule_country/pyproject.toml b/modules/account_tax_rule_country/pyproject.toml new file mode 100644 index 0000000000..ef1d00fa4c --- /dev/null +++ b/modules/account_tax_rule_country/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_account_tax_rule_country' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Tax rules per country for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +account_tax_rule_country = 'trytond.modules.account_tax_rule_country' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-account-tax-rule-country/" +changelog = "https://docs.tryton.org/modules-account-tax-rule-country/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/account_tax_rule_country" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/account_tax_rule_country/setup.py b/modules/account_tax_rule_country/setup.py deleted file mode 100755 index ccc494a4a1..0000000000 --- a/modules/account_tax_rule_country/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_account_tax_rule_country' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] -for dep in ['account_invoice', 'sale', 'purchase', 'stock']: - tests_require.append(get_require_version('trytond_%s' % dep)) - -setup(name=name, - version=version, - description='Tryton module to add countries on tax rules', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-account-tax-rule-country'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton account tax rule country', - package_dir={'trytond.modules.account_tax_rule_country': '.'}, - packages=( - ['trytond.modules.account_tax_rule_country'] - + ['trytond.modules.account_tax_rule_country.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.account_tax_rule_country': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - account_tax_rule_country = trytond.modules.account_tax_rule_country - """, - ) diff --git a/modules/account_tax_rule_country/tox.ini b/modules/account_tax_rule_country/tox.ini index 53e3ce4cf0..83f1024be8 100644 --- a/modules/account_tax_rule_country/tox.ini +++ b/modules/account_tax_rule_country/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.account_tax_rule_country --omit=*/tests/* -m xmlrunner discover -s trytond.modules.account_tax_rule_country {posargs} commands_post = coverage report coverage xml diff --git a/modules/analytic_account/COPYRIGHT b/modules/analytic_account/COPYRIGHT index 2babb3e0a8..e35e734acd 100644 --- a/modules/analytic_account/COPYRIGHT +++ b/modules/analytic_account/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/analytic_account/MANIFEST.in b/modules/analytic_account/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/analytic_account/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/analytic_account/doc/conf.py b/modules/analytic_account/doc/conf.py index b72d6d9819..f7418f77ba 100644 --- a/modules/analytic_account/doc/conf.py +++ b/modules/analytic_account/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/analytic_account/doc/requirements-doc.txt b/modules/analytic_account/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/analytic_account/doc/requirements-doc.txt +++ b/modules/analytic_account/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/analytic_account/pyproject.toml b/modules/analytic_account/pyproject.toml new file mode 100644 index 0000000000..3b03ca4a43 --- /dev/null +++ b/modules/analytic_account/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_analytic_account' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Analytic accounting for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +analytic_account = 'trytond.modules.analytic_account' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-analytic-account/" +changelog = "https://docs.tryton.org/modules-analytic-account/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/analytic_account" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/analytic_account/setup.py b/modules/analytic_account/setup.py deleted file mode 100755 index 32161fe9ac..0000000000 --- a/modules/analytic_account/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_analytic_account' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for analytic accounting', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-analytic-account'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton analytic account', - package_dir={'trytond.modules.analytic_account': '.'}, - packages=( - ['trytond.modules.analytic_account'] - + ['trytond.modules.analytic_account.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.analytic_account': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - analytic_account = trytond.modules.analytic_account - """, - ) diff --git a/modules/analytic_account/tox.ini b/modules/analytic_account/tox.ini index 53e3ce4cf0..5709e5529e 100644 --- a/modules/analytic_account/tox.ini +++ b/modules/analytic_account/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.analytic_account --omit=*/tests/* -m xmlrunner discover -s trytond.modules.analytic_account {posargs} commands_post = coverage report coverage xml diff --git a/modules/analytic_budget/COPYRIGHT b/modules/analytic_budget/COPYRIGHT index 1f73308cb4..0595a2babf 100644 --- a/modules/analytic_budget/COPYRIGHT +++ b/modules/analytic_budget/COPYRIGHT @@ -1,8 +1,8 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier Copyright (C) 2020-2021 David Harper Copyright (C) 2019 Adrián Bernardi -Copyright (C) 2016 Sergi Almacellas Abellana +Copyright (C) 2016 Sergi Almacellas Abellana This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/analytic_budget/MANIFEST.in b/modules/analytic_budget/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/analytic_budget/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/analytic_budget/doc/conf.py b/modules/analytic_budget/doc/conf.py index 5e4dc96822..9eb586d6f7 100644 --- a/modules/analytic_budget/doc/conf.py +++ b/modules/analytic_budget/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/analytic_budget/doc/requirements-doc.txt b/modules/analytic_budget/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/analytic_budget/doc/requirements-doc.txt +++ b/modules/analytic_budget/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/analytic_budget/pyproject.toml b/modules/analytic_budget/pyproject.toml new file mode 100644 index 0000000000..5e35b26895 --- /dev/null +++ b/modules/analytic_budget/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_analytic_budget' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Analytic budget for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "budget"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +analytic_budget = 'trytond.modules.analytic_budget' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-analytic-budget/" +changelog = "https://docs.tryton.org/modules-analytic-budget/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/analytic_budget" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/analytic_budget/setup.py b/modules/analytic_budget/setup.py deleted file mode 100755 index 5971fc234e..0000000000 --- a/modules/analytic_budget/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_analytic_budget' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description=( - 'Tryton module that allows creating budgets for analytic accounts'), - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": - 'https://docs.tryton.org/modules-analytic-budget', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton analytic account budget', - package_dir={'trytond.modules.analytic_budget': '.'}, - packages=( - ['trytond.modules.analytic_budget'] - + ['trytond.modules.analytic_budget.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.analytic_budget': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - analytic_budget = trytond.modules.analytic_budget - """, # noqa: E501 - ) diff --git a/modules/analytic_budget/tox.ini b/modules/analytic_budget/tox.ini index 53e3ce4cf0..c3d787649b 100644 --- a/modules/analytic_budget/tox.ini +++ b/modules/analytic_budget/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.analytic_budget --omit=*/tests/* -m xmlrunner discover -s trytond.modules.analytic_budget {posargs} commands_post = coverage report coverage xml diff --git a/modules/analytic_invoice/COPYRIGHT b/modules/analytic_invoice/COPYRIGHT index f9702c30ca..bfecfa3ea1 100644 --- a/modules/analytic_invoice/COPYRIGHT +++ b/modules/analytic_invoice/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2012 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2012 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/analytic_invoice/MANIFEST.in b/modules/analytic_invoice/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/analytic_invoice/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/analytic_invoice/doc/conf.py b/modules/analytic_invoice/doc/conf.py index 119e11c49c..7d8b329b7c 100644 --- a/modules/analytic_invoice/doc/conf.py +++ b/modules/analytic_invoice/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/analytic_invoice/doc/requirements-doc.txt b/modules/analytic_invoice/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/analytic_invoice/doc/requirements-doc.txt +++ b/modules/analytic_invoice/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/analytic_invoice/pyproject.toml b/modules/analytic_invoice/pyproject.toml new file mode 100644 index 0000000000..60ed85bf94 --- /dev/null +++ b/modules/analytic_invoice/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_analytic_invoice' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Analytic invoice for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +analytic_invoice = 'trytond.modules.analytic_invoice' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-analytic-invoice/" +changelog = "https://docs.tryton.org/modules-analytic-invoice/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/analytic_invoice" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/analytic_invoice/setup.py b/modules/analytic_invoice/setup.py deleted file mode 100755 index 702180f393..0000000000 --- a/modules/analytic_invoice/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_analytic_invoice' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] -for dep in ['account_asset', 'account_invoice_defer']: - tests_require.append(get_require_version('trytond_%s' % dep)) - -setup(name=name, - version=version, - description='Tryton module to add analytic accounting on invoice', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-analytic-invoice'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton analytic account invoice', - package_dir={'trytond.modules.analytic_invoice': '.'}, - packages=( - ['trytond.modules.analytic_invoice'] - + ['trytond.modules.analytic_invoice.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.analytic_invoice': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - analytic_invoice = trytond.modules.analytic_invoice - """, - ) diff --git a/modules/analytic_invoice/tox.ini b/modules/analytic_invoice/tox.ini index 53e3ce4cf0..3daf6d96ed 100644 --- a/modules/analytic_invoice/tox.ini +++ b/modules/analytic_invoice/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.analytic_invoice --omit=*/tests/* -m xmlrunner discover -s trytond.modules.analytic_invoice {posargs} commands_post = coverage report coverage xml diff --git a/modules/analytic_purchase/COPYRIGHT b/modules/analytic_purchase/COPYRIGHT index a392859693..dc839cb31b 100644 --- a/modules/analytic_purchase/COPYRIGHT +++ b/modules/analytic_purchase/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/analytic_purchase/MANIFEST.in b/modules/analytic_purchase/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/analytic_purchase/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/analytic_purchase/doc/conf.py b/modules/analytic_purchase/doc/conf.py index f9c1a14fac..c352f9e2be 100644 --- a/modules/analytic_purchase/doc/conf.py +++ b/modules/analytic_purchase/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/analytic_purchase/doc/requirements-doc.txt b/modules/analytic_purchase/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/analytic_purchase/doc/requirements-doc.txt +++ b/modules/analytic_purchase/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/analytic_purchase/pyproject.toml b/modules/analytic_purchase/pyproject.toml new file mode 100644 index 0000000000..6d89d1897e --- /dev/null +++ b/modules/analytic_purchase/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_analytic_purchase' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Analytic purchase for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +analytic_purchase = 'trytond.modules.analytic_purchase' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-analytic-purchase/" +changelog = "https://docs.tryton.org/modules-analytic-purchase/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/analytic_purchase" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/analytic_purchase/setup.py b/modules/analytic_purchase/setup.py deleted file mode 100755 index d84e25e133..0000000000 --- a/modules/analytic_purchase/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_analytic_purchase' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to add analytic accounting on purchase', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-analytic-purchase'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton analytic account purchase', - package_dir={'trytond.modules.analytic_purchase': '.'}, - packages=( - ['trytond.modules.analytic_purchase'] - + ['trytond.modules.analytic_purchase.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.analytic_purchase': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - analytic_purchase = trytond.modules.analytic_purchase - """, - ) diff --git a/modules/analytic_purchase/tox.ini b/modules/analytic_purchase/tox.ini index 53e3ce4cf0..928476c7cd 100644 --- a/modules/analytic_purchase/tox.ini +++ b/modules/analytic_purchase/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.analytic_purchase --omit=*/tests/* -m xmlrunner discover -s trytond.modules.analytic_purchase {posargs} commands_post = coverage report coverage xml diff --git a/modules/analytic_sale/COPYRIGHT b/modules/analytic_sale/COPYRIGHT index 081457e309..a544f3c309 100644 --- a/modules/analytic_sale/COPYRIGHT +++ b/modules/analytic_sale/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2011 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2011 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/analytic_sale/MANIFEST.in b/modules/analytic_sale/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/analytic_sale/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/analytic_sale/doc/conf.py b/modules/analytic_sale/doc/conf.py index 11a63b9fc4..2f1a2ea26f 100644 --- a/modules/analytic_sale/doc/conf.py +++ b/modules/analytic_sale/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/analytic_sale/doc/requirements-doc.txt b/modules/analytic_sale/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/analytic_sale/doc/requirements-doc.txt +++ b/modules/analytic_sale/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/analytic_sale/pyproject.toml b/modules/analytic_sale/pyproject.toml new file mode 100644 index 0000000000..88fb56f8ce --- /dev/null +++ b/modules/analytic_sale/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_analytic_sale' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Analytic sale for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "accounting", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Accounting", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +analytic_sale = 'trytond.modules.analytic_sale' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-analytic-sale/" +changelog = "https://docs.tryton.org/modules-analytic-sale/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/analytic_sale" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/analytic_sale/setup.py b/modules/analytic_sale/setup.py deleted file mode 100755 index 8d2aad8b07..0000000000 --- a/modules/analytic_sale/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_analytic_sale' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to add analytic accounting on sale', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-analytic-sale'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton analytic account sale', - package_dir={'trytond.modules.analytic_sale': '.'}, - packages=( - ['trytond.modules.analytic_sale'] - + ['trytond.modules.analytic_sale.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.analytic_sale': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - analytic_sale = trytond.modules.analytic_sale - """, - ) diff --git a/modules/analytic_sale/tox.ini b/modules/analytic_sale/tox.ini index 53e3ce4cf0..b7b2d68c23 100644 --- a/modules/analytic_sale/tox.ini +++ b/modules/analytic_sale/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.analytic_sale --omit=*/tests/* -m xmlrunner discover -s trytond.modules.analytic_sale {posargs} commands_post = coverage report coverage xml diff --git a/modules/attendance/COPYRIGHT b/modules/attendance/COPYRIGHT index 6350401fad..dc251ef666 100644 --- a/modules/attendance/COPYRIGHT +++ b/modules/attendance/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2020-2024 Sergi Almacellas Abellana -Copyright (C) 2020-2025 B2CK -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2024 Sergi Almacellas Abellana +Copyright (C) 2020-2025 B2CK SRL +Copyright (C) 2020-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/attendance/MANIFEST.in b/modules/attendance/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/attendance/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/attendance/README.rst b/modules/attendance/README.rst deleted file mode 100644 index 176d9c2695..0000000000 --- a/modules/attendance/README.rst +++ /dev/null @@ -1 +0,0 @@ -doc/index.rst \ No newline at end of file diff --git a/modules/attendance/README.rst b/modules/attendance/README.rst new file mode 120000 index 0000000000..176d9c2695 --- /dev/null +++ b/modules/attendance/README.rst @@ -0,0 +1 @@ +doc/index.rst \ No newline at end of file diff --git a/modules/attendance/doc/conf.py b/modules/attendance/doc/conf.py index 7fa15912f7..00a7f60313 100644 --- a/modules/attendance/doc/conf.py +++ b/modules/attendance/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/attendance/doc/requirements-doc.txt b/modules/attendance/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/attendance/doc/requirements-doc.txt +++ b/modules/attendance/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/attendance/pyproject.toml b/modules/attendance/pyproject.toml new file mode 100644 index 0000000000..091b6bbac6 --- /dev/null +++ b/modules/attendance/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_attendance' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Employee attendance for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "attendance"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +attendance = 'trytond.modules.attendance' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-attendance/" +changelog = "https://docs.tryton.org/modules-attendance/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/attendance" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/attendance/setup.py b/modules/attendance/setup.py deleted file mode 100755 index 8e4994c0af..0000000000 --- a/modules/attendance/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_attendance' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_timesheet'), - ] - -setup(name=name, - version=version, - description='Tryton module for recording employee attendance', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-attendance', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='', - package_dir={'trytond.modules.attendance': '.'}, - packages=( - ['trytond.modules.attendance'] - + ['trytond.modules.attendance.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.attendance': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - attendance = trytond.modules.attendance - """, - ) diff --git a/modules/attendance/tox.ini b/modules/attendance/tox.ini index 53e3ce4cf0..332f8a6c95 100644 --- a/modules/attendance/tox.ini +++ b/modules/attendance/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.attendance --omit=*/tests/* -m xmlrunner discover -s trytond.modules.attendance {posargs} commands_post = coverage report coverage xml diff --git a/modules/authentication_saml/COPYRIGHT b/modules/authentication_saml/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/authentication_saml/COPYRIGHT +++ b/modules/authentication_saml/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/authentication_saml/MANIFEST.in b/modules/authentication_saml/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/authentication_saml/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/authentication_saml/doc/conf.py b/modules/authentication_saml/doc/conf.py index 828c90b01f..0783b4453d 100644 --- a/modules/authentication_saml/doc/conf.py +++ b/modules/authentication_saml/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/authentication_saml/doc/requirements-doc.txt b/modules/authentication_saml/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/authentication_saml/doc/requirements-doc.txt +++ b/modules/authentication_saml/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/authentication_saml/pyproject.toml b/modules/authentication_saml/pyproject.toml new file mode 100644 index 0000000000..9e1e3a8770 --- /dev/null +++ b/modules/authentication_saml/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_authentication_saml' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "SAML authentication for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "authentication", "SAML"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +authentication_saml = 'trytond.modules.authentication_saml' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-authentication-saml/" +changelog = "https://docs.tryton.org/modules-authentication-saml/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/authentication_saml" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['pysaml2'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/authentication_saml/setup.py b/modules/authentication_saml/setup.py deleted file mode 100755 index 49a51064c0..0000000000 --- a/modules/authentication_saml/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_authentication_saml' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['pysaml2'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to authenticate users via SAML', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-authentication-saml'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton SAML authentication SSO', - package_dir={'trytond.modules.authentication_saml': '.'}, - packages=( - ['trytond.modules.authentication_saml'] - + ['trytond.modules.authentication_saml.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.authentication_saml': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - authentication_saml = trytond.modules.authentication_saml - """, # noqa: E501 - ) diff --git a/modules/authentication_saml/tox.ini b/modules/authentication_saml/tox.ini index 53e3ce4cf0..8107fe221d 100644 --- a/modules/authentication_saml/tox.ini +++ b/modules/authentication_saml/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.authentication_saml --omit=*/tests/* -m xmlrunner discover -s trytond.modules.authentication_saml {posargs} commands_post = coverage report coverage xml diff --git a/modules/authentication_sms/COPYRIGHT b/modules/authentication_sms/COPYRIGHT index 6a52e8a2ed..494e851304 100644 --- a/modules/authentication_sms/COPYRIGHT +++ b/modules/authentication_sms/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2016-2025 B2CK -Copyright (C) 2016-2025 Cédric Krier +Copyright (C) 2016-2025 B2CK SRL +Copyright (C) 2016-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/authentication_sms/MANIFEST.in b/modules/authentication_sms/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/authentication_sms/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/authentication_sms/doc/conf.py b/modules/authentication_sms/doc/conf.py index 0eb73c086a..714ed84361 100644 --- a/modules/authentication_sms/doc/conf.py +++ b/modules/authentication_sms/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/authentication_sms/doc/requirements-doc.txt b/modules/authentication_sms/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/authentication_sms/doc/requirements-doc.txt +++ b/modules/authentication_sms/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/authentication_sms/pyproject.toml b/modules/authentication_sms/pyproject.toml new file mode 100644 index 0000000000..bd217ea20a --- /dev/null +++ b/modules/authentication_sms/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_authentication_sms' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "SMS authentication for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "authentication", "SMS"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +authentication_sms = 'trytond.modules.authentication_sms' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-authentication-sms/" +changelog = "https://docs.tryton.org/modules-authentication-sms/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/authentication_sms" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/authentication_sms/setup.py b/modules/authentication_sms/setup.py deleted file mode 100755 index 867b86c120..0000000000 --- a/modules/authentication_sms/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_authentication_sms' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to authenticate users via SMS', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-authentication-sms'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sms authentication two-factor 2FA', - package_dir={'trytond.modules.authentication_sms': '.'}, - packages=( - ['trytond.modules.authentication_sms'] - + ['trytond.modules.authentication_sms.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.authentication_sms': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - authentication_sms = trytond.modules.authentication_sms - """, - ) diff --git a/modules/authentication_sms/tox.ini b/modules/authentication_sms/tox.ini index 53e3ce4cf0..a019d7fa46 100644 --- a/modules/authentication_sms/tox.ini +++ b/modules/authentication_sms/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.authentication_sms --omit=*/tests/* -m xmlrunner discover -s trytond.modules.authentication_sms {posargs} commands_post = coverage report coverage xml diff --git a/modules/bank/COPYRIGHT b/modules/bank/COPYRIGHT index c5f9863cf1..a2d4e65b8c 100644 --- a/modules/bank/COPYRIGHT +++ b/modules/bank/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2013-2025 Cédric Krier. -Copyright (C) 2013-2025 B2CK SPRL. +Copyright (C) 2013-2025 Cédric Krier +Copyright (C) 2013-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/bank/MANIFEST.in b/modules/bank/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/bank/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/bank/doc/conf.py b/modules/bank/doc/conf.py index 7690892be0..5e3714fd8a 100644 --- a/modules/bank/doc/conf.py +++ b/modules/bank/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/bank/doc/requirements-doc.txt b/modules/bank/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/bank/doc/requirements-doc.txt +++ b/modules/bank/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/bank/pyproject.toml b/modules/bank/pyproject.toml new file mode 100644 index 0000000000..99e36928ca --- /dev/null +++ b/modules/bank/pyproject.toml @@ -0,0 +1,66 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_bank' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Banks for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "bank"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +bank = 'trytond.modules.bank' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-bank/" +changelog = "https://docs.tryton.org/modules-bank/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/bank" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql >= 0.4', + 'python-stdnum', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.optional-dependencies] +SWIFT = ['schwifty>=2020.01.0'] +test = ['schwifty'] + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/bank/setup.py b/modules/bank/setup.py deleted file mode 100755 index 6429ec7d37..0000000000 --- a/modules/bank/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_bank' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-stdnum', 'python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = ['schwifty'] - -setup(name=name, - version=version, - description='Tryton module with banks', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-bank', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton bank', - package_dir={'trytond.modules.bank': '.'}, - packages=( - ['trytond.modules.bank'] - + ['trytond.modules.bank.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.bank': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'SWIFT': ['schwifty>=2020.01.0'], - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - bank = trytond.modules.bank - """, - ) diff --git a/modules/bank/tox.ini b/modules/bank/tox.ini index 53e3ce4cf0..bf55490f78 100644 --- a/modules/bank/tox.ini +++ b/modules/bank/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.bank --omit=*/tests/* -m xmlrunner discover -s trytond.modules.bank {posargs} commands_post = coverage report coverage xml diff --git a/modules/carrier/COPYRIGHT b/modules/carrier/COPYRIGHT index 00b70dfe19..388749897b 100644 --- a/modules/carrier/COPYRIGHT +++ b/modules/carrier/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2013 Bertrand Chenal. -Copyright (C) 2011-2025 Nicolas Évrard. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2013 Bertrand Chenal +Copyright (C) 2011-2025 Nicolas Évrard +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/carrier/MANIFEST.in b/modules/carrier/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/carrier/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/carrier/doc/conf.py b/modules/carrier/doc/conf.py index 14463fb679..4f00a82f53 100644 --- a/modules/carrier/doc/conf.py +++ b/modules/carrier/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/carrier/doc/requirements-doc.txt b/modules/carrier/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/carrier/doc/requirements-doc.txt +++ b/modules/carrier/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/carrier/pyproject.toml b/modules/carrier/pyproject.toml new file mode 100644 index 0000000000..29ff129e23 --- /dev/null +++ b/modules/carrier/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_carrier' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Carriers for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "carrier"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +carrier = 'trytond.modules.carrier' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-carrier/" +changelog = "https://docs.tryton.org/modules-carrier/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/carrier" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/carrier/setup.py b/modules/carrier/setup.py deleted file mode 100755 index e3bd7124ef..0000000000 --- a/modules/carrier/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_carrier' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module with carriers', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-carrier', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton carrier', - package_dir={'trytond.modules.carrier': '.'}, - packages=( - ['trytond.modules.carrier'] - + ['trytond.modules.carrier.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.carrier': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - carrier = trytond.modules.carrier - """, - ) diff --git a/modules/carrier/tox.ini b/modules/carrier/tox.ini index 53e3ce4cf0..422d17b4b3 100644 --- a/modules/carrier/tox.ini +++ b/modules/carrier/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.carrier --omit=*/tests/* -m xmlrunner discover -s trytond.modules.carrier {posargs} commands_post = coverage report coverage xml diff --git a/modules/carrier_carriage/COPYRIGHT b/modules/carrier_carriage/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/carrier_carriage/COPYRIGHT +++ b/modules/carrier_carriage/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/carrier_carriage/MANIFEST.in b/modules/carrier_carriage/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/carrier_carriage/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/carrier_carriage/doc/conf.py b/modules/carrier_carriage/doc/conf.py index 8b6435979e..79ead17c1f 100644 --- a/modules/carrier_carriage/doc/conf.py +++ b/modules/carrier_carriage/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/carrier_carriage/doc/requirements-doc.txt b/modules/carrier_carriage/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/carrier_carriage/doc/requirements-doc.txt +++ b/modules/carrier_carriage/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/carrier_carriage/pyproject.toml b/modules/carrier_carriage/pyproject.toml new file mode 100644 index 0000000000..8b491479ee --- /dev/null +++ b/modules/carrier_carriage/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_carrier_carriage' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Multiple carriers for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "carrier"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +carrier_carriage = 'trytond.modules.carrier_carriage' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-carrier-carriage/" +changelog = "https://docs.tryton.org/modules-carrier-carriage/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/carrier_carriage" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/carrier_carriage/setup.py b/modules/carrier_carriage/setup.py deleted file mode 100755 index c185b1bb3b..0000000000 --- a/modules/carrier_carriage/setup.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_carrier_carriage' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_invoice'), - get_require_version('trytond_incoterm'), - get_require_version('trytond_purchase_shipment_cost'), - get_require_version('trytond_sale_shipment_cost'), - ] - -setup(name=name, - version=version, - description='Tryton module to support multiple carrier', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-carrier-carriage'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton carrier carriage shipment cost', - package_dir={'trytond.modules.carrier_carriage': '.'}, - packages=( - ['trytond.modules.carrier_carriage'] - + ['trytond.modules.carrier_carriage.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.carrier_carriage': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - carrier_carriage = trytond.modules.carrier_carriage - """, # noqa: E501 - ) diff --git a/modules/carrier_carriage/tox.ini b/modules/carrier_carriage/tox.ini index 53e3ce4cf0..ccc2250c94 100644 --- a/modules/carrier_carriage/tox.ini +++ b/modules/carrier_carriage/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.carrier_carriage --omit=*/tests/* -m xmlrunner discover -s trytond.modules.carrier_carriage {posargs} commands_post = coverage report coverage xml diff --git a/modules/carrier_percentage/COPYRIGHT b/modules/carrier_percentage/COPYRIGHT index 3bc89e0de8..4126e0f40b 100644 --- a/modules/carrier_percentage/COPYRIGHT +++ b/modules/carrier_percentage/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2012 Bertrand Chenal. -Copyright (C) 2011-2025 Nicolas Évrard. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2012 Bertrand Chenal +Copyright (C) 2011-2025 Nicolas Évrard +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/carrier_percentage/MANIFEST.in b/modules/carrier_percentage/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/carrier_percentage/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/carrier_percentage/doc/conf.py b/modules/carrier_percentage/doc/conf.py index bfe8b8601f..0f5af4ec2e 100644 --- a/modules/carrier_percentage/doc/conf.py +++ b/modules/carrier_percentage/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/carrier_percentage/doc/requirements-doc.txt b/modules/carrier_percentage/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/carrier_percentage/doc/requirements-doc.txt +++ b/modules/carrier_percentage/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/carrier_percentage/pyproject.toml b/modules/carrier_percentage/pyproject.toml new file mode 100644 index 0000000000..6b4e73dbaf --- /dev/null +++ b/modules/carrier_percentage/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_carrier_percentage' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Percentage carrier cost for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "carrier"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +carrier_percentage = 'trytond.modules.carrier_percentage' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-carrier-percentage/" +changelog = "https://docs.tryton.org/modules-carrier-percentage/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/carrier_percentage" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/carrier_percentage/setup.py b/modules/carrier_percentage/setup.py deleted file mode 100755 index 2d1c25dcac..0000000000 --- a/modules/carrier_percentage/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_carrier_percentage' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_purchase_shipment_cost'), - get_require_version('trytond_sale_shipment_cost'), - get_require_version('trytond_stock_shipment_cost'), - ] - -setup(name=name, - version=version, - description='Tryton module to add cost method "on percentage" on carrier', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-carrier-percentage'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton carrier percentage', - package_dir={'trytond.modules.carrier_percentage': '.'}, - packages=( - ['trytond.modules.carrier_percentage'] - + ['trytond.modules.carrier_percentage.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.carrier_percentage': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - carrier_percentage = trytond.modules.carrier_percentage - """, - ) diff --git a/modules/carrier_percentage/tox.ini b/modules/carrier_percentage/tox.ini index 53e3ce4cf0..7ce7d68d27 100644 --- a/modules/carrier_percentage/tox.ini +++ b/modules/carrier_percentage/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.carrier_percentage --omit=*/tests/* -m xmlrunner discover -s trytond.modules.carrier_percentage {posargs} commands_post = coverage report coverage xml diff --git a/modules/carrier_subdivision/COPYRIGHT b/modules/carrier_subdivision/COPYRIGHT index 204110c948..c2f9a8a026 100644 --- a/modules/carrier_subdivision/COPYRIGHT +++ b/modules/carrier_subdivision/COPYRIGHT @@ -1,4 +1,4 @@ -Copyright (C) 2020-2021 Sergi Almacellas Abellana +Copyright (C) 2020-2021 Sergi Almacellas Abellana This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/carrier_subdivision/MANIFEST.in b/modules/carrier_subdivision/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/carrier_subdivision/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/carrier_subdivision/README.rst b/modules/carrier_subdivision/README.rst deleted file mode 100644 index 176d9c2695..0000000000 --- a/modules/carrier_subdivision/README.rst +++ /dev/null @@ -1 +0,0 @@ -doc/index.rst \ No newline at end of file diff --git a/modules/carrier_subdivision/README.rst b/modules/carrier_subdivision/README.rst new file mode 120000 index 0000000000..176d9c2695 --- /dev/null +++ b/modules/carrier_subdivision/README.rst @@ -0,0 +1 @@ +doc/index.rst \ No newline at end of file diff --git a/modules/carrier_subdivision/doc/conf.py b/modules/carrier_subdivision/doc/conf.py index 2c472cc366..06c5b35e6f 100644 --- a/modules/carrier_subdivision/doc/conf.py +++ b/modules/carrier_subdivision/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/carrier_subdivision/doc/requirements-doc.txt b/modules/carrier_subdivision/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/carrier_subdivision/doc/requirements-doc.txt +++ b/modules/carrier_subdivision/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/carrier_subdivision/pyproject.toml b/modules/carrier_subdivision/pyproject.toml new file mode 100644 index 0000000000..ba635d9be5 --- /dev/null +++ b/modules/carrier_subdivision/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_carrier_subdivision' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Carrier selection per subdivision for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "carrier"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +carrier_subdivision = 'trytond.modules.carrier_subdivision' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-carrier-subdivision/" +changelog = "https://docs.tryton.org/modules-carrier-subdivision/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/carrier_subdivision" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/carrier_subdivision/setup.py b/modules/carrier_subdivision/setup.py deleted file mode 100755 index deac529d7e..0000000000 --- a/modules/carrier_subdivision/setup.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_carrier_subdivision' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale_shipment_cost'), - get_require_version('trytond_carrier_carriage'), - ] - -setup(name=name, - version=version, - description="Tryton module that allows carriers selection to be restricted" - "by subdivision", - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-carrier-subdivision'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='', - package_dir={'trytond.modules.carrier_subdivision': '.'}, - packages=( - ['trytond.modules.carrier_subdivision'] - + ['trytond.modules.carrier_subdivision.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.carrier_subdivision': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - carrier_subdivision = trytond.modules.carrier_subdivision - """, # noqa: E501 - ) diff --git a/modules/carrier_subdivision/tox.ini b/modules/carrier_subdivision/tox.ini index 53e3ce4cf0..58a0745a96 100644 --- a/modules/carrier_subdivision/tox.ini +++ b/modules/carrier_subdivision/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.carrier_subdivision --omit=*/tests/* -m xmlrunner discover -s trytond.modules.carrier_subdivision {posargs} commands_post = coverage report coverage xml diff --git a/modules/carrier_weight/COPYRIGHT b/modules/carrier_weight/COPYRIGHT index 00b70dfe19..388749897b 100644 --- a/modules/carrier_weight/COPYRIGHT +++ b/modules/carrier_weight/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2013 Bertrand Chenal. -Copyright (C) 2011-2025 Nicolas Évrard. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2013 Bertrand Chenal +Copyright (C) 2011-2025 Nicolas Évrard +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/carrier_weight/MANIFEST.in b/modules/carrier_weight/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/carrier_weight/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/carrier_weight/doc/conf.py b/modules/carrier_weight/doc/conf.py index 0f2cfbf5b2..b1a86248de 100644 --- a/modules/carrier_weight/doc/conf.py +++ b/modules/carrier_weight/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/carrier_weight/doc/requirements-doc.txt b/modules/carrier_weight/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/carrier_weight/doc/requirements-doc.txt +++ b/modules/carrier_weight/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/carrier_weight/pyproject.toml b/modules/carrier_weight/pyproject.toml new file mode 100644 index 0000000000..926c12bfb7 --- /dev/null +++ b/modules/carrier_weight/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_carrier_weight' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Weight carrier cost for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "carrier"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +carrier_weight = 'trytond.modules.carrier_weight' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-carrier-weight/" +changelog = "https://docs.tryton.org/modules-carrier-weight/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/carrier_weight" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/carrier_weight/setup.py b/modules/carrier_weight/setup.py deleted file mode 100755 index 274c21108c..0000000000 --- a/modules/carrier_weight/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_carrier_weight' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_purchase_shipment_cost'), - get_require_version('trytond_sale_shipment_cost'), - get_require_version('trytond_stock_shipment_cost'), - ] - -setup(name=name, - version=version, - description='Tryton module to add cost method "on weight" on carrier', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-carrier-weight'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton carrier weight', - package_dir={'trytond.modules.carrier_weight': '.'}, - packages=( - ['trytond.modules.carrier_weight'] - + ['trytond.modules.carrier_weight.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.carrier_weight': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - carrier_weight = trytond.modules.carrier_weight - """, - ) diff --git a/modules/carrier_weight/tox.ini b/modules/carrier_weight/tox.ini index 53e3ce4cf0..67ffffba4e 100644 --- a/modules/carrier_weight/tox.ini +++ b/modules/carrier_weight/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.carrier_weight --omit=*/tests/* -m xmlrunner discover -s trytond.modules.carrier_weight {posargs} commands_post = coverage report coverage xml diff --git a/modules/commission/COPYRIGHT b/modules/commission/COPYRIGHT index 5dc3a55ac5..ac13c671f3 100644 --- a/modules/commission/COPYRIGHT +++ b/modules/commission/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2014-2025 Cédric Krier. -Copyright (C) 2014-2025 B2CK SPRL. +Copyright (C) 2014-2025 Cédric Krier +Copyright (C) 2014-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/commission/MANIFEST.in b/modules/commission/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/commission/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/commission/doc/conf.py b/modules/commission/doc/conf.py index e049ba7e3c..a68fc4edfd 100644 --- a/modules/commission/doc/conf.py +++ b/modules/commission/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/commission/doc/requirements-doc.txt b/modules/commission/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/commission/doc/requirements-doc.txt +++ b/modules/commission/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/commission/pyproject.toml b/modules/commission/pyproject.toml new file mode 100644 index 0000000000..88f92db04b --- /dev/null +++ b/modules/commission/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_commission' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Commission for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "commission"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +commission = 'trytond.modules.commission' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-commission/" +changelog = "https://docs.tryton.org/modules-commission/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/commission" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-dateutil', + 'python-sql', + 'simpleeval', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/commission/setup.py b/modules/commission/setup.py deleted file mode 100755 index fba00b7c21..0000000000 --- a/modules/commission/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_commission' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['simpleeval', 'python-sql', 'python-dateutil'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_invoice_stock'), - get_require_version('trytond_sale'), - get_require_version('trytond_stock'), - ] - -setup(name=name, - version=version, - description='Tryton module for commission', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton commission', - package_dir={'trytond.modules.commission': '.'}, - packages=( - ['trytond.modules.commission'] - + ['trytond.modules.commission.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.commission': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst', - 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - commission = trytond.modules.commission - """, - ) diff --git a/modules/commission/tox.ini b/modules/commission/tox.ini index 53e3ce4cf0..3f47880684 100644 --- a/modules/commission/tox.ini +++ b/modules/commission/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.commission --omit=*/tests/* -m xmlrunner discover -s trytond.modules.commission {posargs} commands_post = coverage report coverage xml diff --git a/modules/commission_waiting/COPYRIGHT b/modules/commission_waiting/COPYRIGHT index 5dc3a55ac5..ac13c671f3 100644 --- a/modules/commission_waiting/COPYRIGHT +++ b/modules/commission_waiting/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2014-2025 Cédric Krier. -Copyright (C) 2014-2025 B2CK SPRL. +Copyright (C) 2014-2025 Cédric Krier +Copyright (C) 2014-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/commission_waiting/MANIFEST.in b/modules/commission_waiting/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/commission_waiting/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/commission_waiting/doc/conf.py b/modules/commission_waiting/doc/conf.py index 495d644bb7..aa370cab44 100644 --- a/modules/commission_waiting/doc/conf.py +++ b/modules/commission_waiting/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/commission_waiting/doc/requirements-doc.txt b/modules/commission_waiting/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/commission_waiting/doc/requirements-doc.txt +++ b/modules/commission_waiting/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/commission_waiting/pyproject.toml b/modules/commission_waiting/pyproject.toml new file mode 100644 index 0000000000..bf6e5d97eb --- /dev/null +++ b/modules/commission_waiting/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_commission_waiting' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Commission waiting for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "commission"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +commission_waiting = 'trytond.modules.commission_waiting' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-commission-waiting/" +changelog = "https://docs.tryton.org/modules-commission-waiting/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/commission_waiting" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/commission_waiting/setup.py b/modules/commission_waiting/setup.py deleted file mode 100755 index e53f7ffa27..0000000000 --- a/modules/commission_waiting/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_commission_waiting' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for commission waiting', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-commission-waiting'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton commission', - package_dir={'trytond.modules.commission_waiting': '.'}, - packages=( - ['trytond.modules.commission_waiting'] - + ['trytond.modules.commission_waiting.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.commission_waiting': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - commission_waiting = trytond.modules.commission_waiting - """, - ) diff --git a/modules/commission_waiting/tox.ini b/modules/commission_waiting/tox.ini index 53e3ce4cf0..58b49d5cae 100644 --- a/modules/commission_waiting/tox.ini +++ b/modules/commission_waiting/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.commission_waiting --omit=*/tests/* -m xmlrunner discover -s trytond.modules.commission_waiting {posargs} commands_post = coverage report coverage xml diff --git a/modules/company/COPYRIGHT b/modules/company/COPYRIGHT index a392859693..dc839cb31b 100644 --- a/modules/company/COPYRIGHT +++ b/modules/company/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/company/MANIFEST.in b/modules/company/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/company/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/company/doc/conf.py b/modules/company/doc/conf.py index 614e362d41..11472672f8 100644 --- a/modules/company/doc/conf.py +++ b/modules/company/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/company/doc/requirements-doc.txt b/modules/company/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/company/doc/requirements-doc.txt +++ b/modules/company/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/company/pyproject.toml b/modules/company/pyproject.toml new file mode 100644 index 0000000000..07b03429fc --- /dev/null +++ b/modules/company/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_company' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Companies and employees for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "company", "employee"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +company = 'trytond.modules.company' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-company/" +changelog = "https://docs.tryton.org/modules-company/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/company" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/company/setup.py b/modules/company/setup.py deleted file mode 100755 index 8aa861444d..0000000000 --- a/modules/company/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_company' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module with companies and employees', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-company/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton company employee', - package_dir={'trytond.modules.company': '.'}, - packages=( - ['trytond.modules.company'] - + ['trytond.modules.company.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.company': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'image': ['pillow'], - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - company = trytond.modules.company - """, - ) diff --git a/modules/company/tox.ini b/modules/company/tox.ini index 53e3ce4cf0..0ae61c4bdb 100644 --- a/modules/company/tox.ini +++ b/modules/company/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.company --omit=*/tests/* -m xmlrunner discover -s trytond.modules.company {posargs} commands_post = coverage report coverage xml diff --git a/modules/company_work_time/COPYRIGHT b/modules/company_work_time/COPYRIGHT index 3c933baa0c..e8c9eb806d 100644 --- a/modules/company_work_time/COPYRIGHT +++ b/modules/company_work_time/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2009-2025 Cédric Krier. -Copyright (C) 2009-2012 Bertrand Chenal. -Copyright (C) 2009-2025 B2CK SPRL. +Copyright (C) 2009-2025 Cédric Krier +Copyright (C) 2009-2012 Bertrand Chenal +Copyright (C) 2009-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/company_work_time/MANIFEST.in b/modules/company_work_time/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/company_work_time/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/company_work_time/doc/conf.py b/modules/company_work_time/doc/conf.py index 80d9d1134c..92542abc84 100644 --- a/modules/company_work_time/doc/conf.py +++ b/modules/company_work_time/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/company_work_time/doc/requirements-doc.txt b/modules/company_work_time/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/company_work_time/doc/requirements-doc.txt +++ b/modules/company_work_time/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/company_work_time/pyproject.toml b/modules/company_work_time/pyproject.toml new file mode 100644 index 0000000000..d9c4e6ff38 --- /dev/null +++ b/modules/company_work_time/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_company_work_time' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Company work time for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "company"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +company_work_time = 'trytond.modules.company_work_time' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-company-work-time/" +changelog = "https://docs.tryton.org/modules-company-work-time/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/company_work_time" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/company_work_time/setup.py b/modules/company_work_time/setup.py deleted file mode 100755 index 21aec79eca..0000000000 --- a/modules/company_work_time/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_company_work_time' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to add work time on company', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-company-work-time'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton company work time', - package_dir={'trytond.modules.company_work_time': '.'}, - packages=( - ['trytond.modules.company_work_time'] - + ['trytond.modules.company_work_time.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.company_work_time': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - company_work_time = trytond.modules.company_work_time - """, - ) diff --git a/modules/company_work_time/tox.ini b/modules/company_work_time/tox.ini index 53e3ce4cf0..6ab92bafd4 100644 --- a/modules/company_work_time/tox.ini +++ b/modules/company_work_time/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.company_work_time --omit=*/tests/* -m xmlrunner discover -s trytond.modules.company_work_time {posargs} commands_post = coverage report coverage xml diff --git a/modules/country/COPYRIGHT b/modules/country/COPYRIGHT index 2babb3e0a8..e35e734acd 100644 --- a/modules/country/COPYRIGHT +++ b/modules/country/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/country/MANIFEST.in b/modules/country/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/country/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/country/doc/conf.py b/modules/country/doc/conf.py index 603d60a64a..e91e2743ac 100644 --- a/modules/country/doc/conf.py +++ b/modules/country/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/country/doc/requirements-doc.txt b/modules/country/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/country/doc/requirements-doc.txt +++ b/modules/country/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/country/pyproject.toml b/modules/country/pyproject.toml new file mode 100644 index 0000000000..7d263dbb8e --- /dev/null +++ b/modules/country/pyproject.toml @@ -0,0 +1,70 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_country' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Countries and subdivisions for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "country"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +country = 'trytond.modules.country' + +[project.scripts] +trytond_import_countries = 'trytond.modules.country.scripts.import_countries:run [data]' +trytond_import_postal_codes = 'trytond.modules.country.scripts.import_postal_codes:run [GeoNames]' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-country/" +changelog = "https://docs.tryton.org/modules-country/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/country" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.optional-dependencies] +completion = ['argcomplete'] +data = ['pycountry >= 16.11.8'] +test = ['pycountry >= 16.11.8'] + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +GeoNames = ['proteus'] +data = ['proteus'] +test = ['proteus'] diff --git a/modules/country/setup.py b/modules/country/setup.py deleted file mode 100755 index c3bd8b1189..0000000000 --- a/modules/country/setup.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_country' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), 'pycountry >= 16.11.8'] - -setup(name=name, - version=version, - description='Tryton module with countries', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-country/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton country', - package_dir={'trytond.modules.country': '.'}, - packages=( - ['trytond.modules.country'] - + ['trytond.modules.country.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.country': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'data': ['pycountry >= 16.11.8', get_require_version('proteus')], - 'test': tests_require, - 'GeoNames': [get_require_version('proteus')], - 'completion': ['argcomplete'], - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - country = trytond.modules.country - [console_scripts] - trytond_import_countries = trytond.modules.country.scripts.import_countries:run [data] - trytond_import_postal_codes = trytond.modules.country.scripts.import_postal_codes:run [GeoNames] - """, # noqa: E501 - ) diff --git a/modules/country/tox.ini b/modules/country/tox.ini index 53e3ce4cf0..a67ec36586 100644 --- a/modules/country/tox.ini +++ b/modules/country/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.country --omit=*/tests/* -m xmlrunner discover -s trytond.modules.country {posargs} commands_post = coverage report coverage xml diff --git a/modules/currency/COPYRIGHT b/modules/currency/COPYRIGHT index a392859693..dc839cb31b 100644 --- a/modules/currency/COPYRIGHT +++ b/modules/currency/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/currency/MANIFEST.in b/modules/currency/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/currency/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/currency/doc/conf.py b/modules/currency/doc/conf.py index b67622ccd8..6d452d3902 100644 --- a/modules/currency/doc/conf.py +++ b/modules/currency/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/currency/doc/requirements-doc.txt b/modules/currency/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/currency/doc/requirements-doc.txt +++ b/modules/currency/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/currency/pyproject.toml b/modules/currency/pyproject.toml new file mode 100644 index 0000000000..f957ea9d5f --- /dev/null +++ b/modules/currency/pyproject.toml @@ -0,0 +1,71 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_currency' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Currencies for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "currency"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +currency = 'trytond.modules.currency' + +[project.scripts] +trytond_import_currencies = 'trytond.modules.currency.scripts.import_currencies:run [data]' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-currency/" +changelog = "https://docs.tryton.org/modules-currency/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/currency" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-dateutil', + 'python-sql >= 0.9', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.optional-dependencies] +completion = ['argcomplete'] +data = ['pycountry'] +test = ['pycountry'] + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +data = ['proteus'] +test = ['proteus'] diff --git a/modules/currency/setup.py b/modules/currency/setup.py deleted file mode 100755 index 24038b0e59..0000000000 --- a/modules/currency/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_currency' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.9', 'python-dateutil'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), 'pycountry'] - -setup(name=name, - version=version, - description='Tryton module with currencies', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-currency/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton currency', - package_dir={'trytond.modules.currency': '.'}, - packages=( - ['trytond.modules.currency'] - + ['trytond.modules.currency.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.currency': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - platforms='any', - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'data': ['pycountry', get_require_version('proteus')], - 'test': tests_require, - 'completion': ['argcomplete'], - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - currency = trytond.modules.currency - [console_scripts] - trytond_import_currencies = trytond.modules.currency.scripts.import_currencies:run [data] - """, # noqa: E501 - ) diff --git a/modules/currency/tox.ini b/modules/currency/tox.ini index 53e3ce4cf0..8ba72058d7 100644 --- a/modules/currency/tox.ini +++ b/modules/currency/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.currency --omit=*/tests/* -m xmlrunner discover -s trytond.modules.currency {posargs} commands_post = coverage report coverage xml diff --git a/modules/currency_ro/COPYRIGHT b/modules/currency_ro/COPYRIGHT index 523289548e..202b682dd7 100644 --- a/modules/currency_ro/COPYRIGHT +++ b/modules/currency_ro/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/currency_ro/MANIFEST.in b/modules/currency_ro/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/currency_ro/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/currency_ro/doc/conf.py b/modules/currency_ro/doc/conf.py index 8011b17fd6..d2d15af9ca 100644 --- a/modules/currency_ro/doc/conf.py +++ b/modules/currency_ro/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/currency_ro/doc/requirements-doc.txt b/modules/currency_ro/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/currency_ro/doc/requirements-doc.txt +++ b/modules/currency_ro/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/currency_ro/pyproject.toml b/modules/currency_ro/pyproject.toml new file mode 100644 index 0000000000..6f8e497180 --- /dev/null +++ b/modules/currency_ro/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_currency_ro' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Currency rates from Romanian National Bank for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "currency"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +currency_ro = 'trytond.modules.currency_ro' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-currency-ro/" +changelog = "https://docs.tryton.org/modules-currency-ro/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/currency_ro" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'lxml', + 'requests', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/currency_ro/setup.py b/modules/currency_ro/setup.py deleted file mode 100755 index 5a1cba84b3..0000000000 --- a/modules/currency_ro/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_currency_ro' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['requests', 'lxml'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Fetch currency rates from the Romanian National Bank', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-currency-ro'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton currency romania', - package_dir={'trytond.modules.currency_ro': '.'}, - packages=( - ['trytond.modules.currency_ro'] - + ['trytond.modules.currency_ro.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.currency_ro': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - currency_ro = trytond.modules.currency_ro - """, # noqa: E501 - ) diff --git a/modules/currency_ro/tox.ini b/modules/currency_ro/tox.ini index 53e3ce4cf0..e38fa44f35 100644 --- a/modules/currency_ro/tox.ini +++ b/modules/currency_ro/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.currency_ro --omit=*/tests/* -m xmlrunner discover -s trytond.modules.currency_ro {posargs} commands_post = coverage report coverage xml diff --git a/modules/currency_rs/COPYRIGHT b/modules/currency_rs/COPYRIGHT index 523289548e..202b682dd7 100644 --- a/modules/currency_rs/COPYRIGHT +++ b/modules/currency_rs/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/currency_rs/MANIFEST.in b/modules/currency_rs/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/currency_rs/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/currency_rs/doc/conf.py b/modules/currency_rs/doc/conf.py index d236a51249..fbc8cd03ca 100644 --- a/modules/currency_rs/doc/conf.py +++ b/modules/currency_rs/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/currency_rs/doc/requirements-doc.txt b/modules/currency_rs/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/currency_rs/doc/requirements-doc.txt +++ b/modules/currency_rs/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/currency_rs/pyproject.toml b/modules/currency_rs/pyproject.toml new file mode 100644 index 0000000000..dd14cf0296 --- /dev/null +++ b/modules/currency_rs/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_currency_rs' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Currency rates from Serbian National Bank for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "currency"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +currency_rs = 'trytond.modules.currency_rs' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-currency-rs/" +changelog = "https://docs.tryton.org/modules-currency-rs/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/currency_rs" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'lxml', + 'zeep', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/currency_rs/setup.py b/modules/currency_rs/setup.py deleted file mode 100755 index a96825565b..0000000000 --- a/modules/currency_rs/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_currency_rs' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['lxml', 'zeep'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Fetch currency rates from the Serbian National Bank', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-currency-rs'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton currency serbia', - package_dir={'trytond.modules.currency_rs': '.'}, - packages=( - ['trytond.modules.currency_rs'] - + ['trytond.modules.currency_rs.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.currency_rs': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - currency_rs = trytond.modules.currency_rs - """, # noqa: E501 - ) diff --git a/modules/currency_rs/tox.ini b/modules/currency_rs/tox.ini index 53e3ce4cf0..f2d9194774 100644 --- a/modules/currency_rs/tox.ini +++ b/modules/currency_rs/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.currency_rs --omit=*/tests/* -m xmlrunner discover -s trytond.modules.currency_rs {posargs} commands_post = coverage report coverage xml diff --git a/modules/customs/COPYRIGHT b/modules/customs/COPYRIGHT index 027b10a997..6c34774f53 100644 --- a/modules/customs/COPYRIGHT +++ b/modules/customs/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/customs/MANIFEST.in b/modules/customs/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/customs/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/customs/doc/conf.py b/modules/customs/doc/conf.py index 2dd9f530ab..d95685b2ed 100644 --- a/modules/customs/doc/conf.py +++ b/modules/customs/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/customs/doc/requirements-doc.txt b/modules/customs/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/customs/doc/requirements-doc.txt +++ b/modules/customs/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/customs/pyproject.toml b/modules/customs/pyproject.toml new file mode 100644 index 0000000000..6e340c2406 --- /dev/null +++ b/modules/customs/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_customs' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Customs for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "customs"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +customs = 'trytond.modules.customs' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-customs/" +changelog = "https://docs.tryton.org/modules-customs/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/customs" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql >= 0.4', + 'simpleeval', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/customs/setup.py b/modules/customs/setup.py deleted file mode 100755 index 43a07d81d7..0000000000 --- a/modules/customs/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_customs' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['simpleeval', 'python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module for customs', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-customs', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton customs tariff duty', - package_dir={'trytond.modules.customs': '.'}, - packages=( - ['trytond.modules.customs'] - + ['trytond.modules.customs.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.customs': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - customs = trytond.modules.customs - """, - ) diff --git a/modules/customs/tox.ini b/modules/customs/tox.ini index 53e3ce4cf0..21d0e16219 100644 --- a/modules/customs/tox.ini +++ b/modules/customs/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.customs --omit=*/tests/* -m xmlrunner discover -s trytond.modules.customs {posargs} commands_post = coverage report coverage xml diff --git a/modules/dashboard/COPYRIGHT b/modules/dashboard/COPYRIGHT index f884df0db0..c798a5d300 100644 --- a/modules/dashboard/COPYRIGHT +++ b/modules/dashboard/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2009-2025 Cédric Krier. -Copyright (C) 2009-2013 Bertrand Chenal. -Copyright (C) 2009-2025 B2CK SPRL. +Copyright (C) 2009-2025 Cédric Krier +Copyright (C) 2009-2013 Bertrand Chenal +Copyright (C) 2009-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/dashboard/MANIFEST.in b/modules/dashboard/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/dashboard/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/dashboard/doc/conf.py b/modules/dashboard/doc/conf.py index 347c54dfec..0ef686d595 100644 --- a/modules/dashboard/doc/conf.py +++ b/modules/dashboard/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/dashboard/doc/requirements-doc.txt b/modules/dashboard/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/dashboard/doc/requirements-doc.txt +++ b/modules/dashboard/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/dashboard/pyproject.toml b/modules/dashboard/pyproject.toml new file mode 100644 index 0000000000..0fe606e904 --- /dev/null +++ b/modules/dashboard/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_dashboard' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Dashboard for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "dashboard"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +dashboard = 'trytond.modules.dashboard' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-dashboard/" +changelog = "https://docs.tryton.org/modules-dashboard/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/dashboard" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'lxml', + 'python-sql >= 0.4', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/dashboard/setup.py b/modules/dashboard/setup.py deleted file mode 100755 index 6807f6c5c6..0000000000 --- a/modules/dashboard/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_dashboard' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['lxml', 'python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module for dashboard', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-dashboard', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton dashboard', - package_dir={'trytond.modules.dashboard': '.'}, - packages=( - ['trytond.modules.dashboard'] - + ['trytond.modules.dashboard.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.dashboard': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - dashboard = trytond.modules.dashboard - """, - ) diff --git a/modules/dashboard/tox.ini b/modules/dashboard/tox.ini index 53e3ce4cf0..c994fc575d 100644 --- a/modules/dashboard/tox.ini +++ b/modules/dashboard/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.dashboard --omit=*/tests/* -m xmlrunner discover -s trytond.modules.dashboard {posargs} commands_post = coverage report coverage xml diff --git a/modules/document_incoming/COPYRIGHT b/modules/document_incoming/COPYRIGHT index 4a054c0870..755de76340 100644 --- a/modules/document_incoming/COPYRIGHT +++ b/modules/document_incoming/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2023-2025 B2CK -Copyright (C) 2023-2025 Cédric Krier +Copyright (C) 2023-2025 B2CK SRL +Copyright (C) 2023-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/document_incoming/MANIFEST.in b/modules/document_incoming/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/document_incoming/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/document_incoming/doc/conf.py b/modules/document_incoming/doc/conf.py index b50db959d0..3bfec8a0b6 100644 --- a/modules/document_incoming/doc/conf.py +++ b/modules/document_incoming/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/document_incoming/doc/requirements-doc.txt b/modules/document_incoming/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/document_incoming/doc/requirements-doc.txt +++ b/modules/document_incoming/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/document_incoming/pyproject.toml b/modules/document_incoming/pyproject.toml new file mode 100644 index 0000000000..e712b88d4a --- /dev/null +++ b/modules/document_incoming/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_document_incoming' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Incoming document in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "incoming document"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +document_incoming = 'trytond.modules.document_incoming' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-document-incoming/" +changelog = "https://docs.tryton.org/modules-document-incoming/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.pdf', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/document_incoming" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['pypdf >= 3'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/document_incoming/setup.py b/modules/document_incoming/setup.py deleted file mode 100755 index 1050dd46c1..0000000000 --- a/modules/document_incoming/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_document_incoming' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['pypdf >= 3'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_inbound_email'), - ] - -setup(name=name, - version=version, - description='Tryton module to manage incoming document', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-document-incoming'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton document incoming', - package_dir={'trytond.modules.document_incoming': '.'}, - packages=( - ['trytond.modules.document_incoming'] - + ['trytond.modules.document_incoming.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.document_incoming': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.pdf']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - document_incoming = trytond.modules.document_incoming - """, # noqa: E501 - ) diff --git a/modules/document_incoming/tox.ini b/modules/document_incoming/tox.ini index 53e3ce4cf0..3fe7f2b742 100644 --- a/modules/document_incoming/tox.ini +++ b/modules/document_incoming/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.document_incoming --omit=*/tests/* -m xmlrunner discover -s trytond.modules.document_incoming {posargs} commands_post = coverage report coverage xml diff --git a/modules/document_incoming_invoice/COPYRIGHT b/modules/document_incoming_invoice/COPYRIGHT index 4a054c0870..755de76340 100644 --- a/modules/document_incoming_invoice/COPYRIGHT +++ b/modules/document_incoming_invoice/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2023-2025 B2CK -Copyright (C) 2023-2025 Cédric Krier +Copyright (C) 2023-2025 B2CK SRL +Copyright (C) 2023-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/document_incoming_invoice/MANIFEST.in b/modules/document_incoming_invoice/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/document_incoming_invoice/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/document_incoming_invoice/doc/conf.py b/modules/document_incoming_invoice/doc/conf.py index 95591431b9..70f1b92593 100644 --- a/modules/document_incoming_invoice/doc/conf.py +++ b/modules/document_incoming_invoice/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/document_incoming_invoice/doc/requirements-doc.txt b/modules/document_incoming_invoice/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/document_incoming_invoice/doc/requirements-doc.txt +++ b/modules/document_incoming_invoice/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/document_incoming_invoice/pyproject.toml b/modules/document_incoming_invoice/pyproject.toml new file mode 100644 index 0000000000..ff1009beb4 --- /dev/null +++ b/modules/document_incoming_invoice/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_document_incoming_invoice' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Incoming Invoice for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "incoming document", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +document_incoming_invoice = 'trytond.modules.document_incoming_invoice' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-document-incoming-invoice/" +changelog = "https://docs.tryton.org/modules-document-incoming-invoice/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/document_incoming_invoice" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/document_incoming_invoice/setup.py b/modules/document_incoming_invoice/setup.py deleted file mode 100755 index 8e6a1f104e..0000000000 --- a/modules/document_incoming_invoice/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_document_incoming_invoice' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to manage incoming invoice document', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-document-incoming-invoice'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton invoice incoming', - package_dir={'trytond.modules.document_incoming_invoice': '.'}, - packages=( - ['trytond.modules.document_incoming_invoice'] - + ['trytond.modules.document_incoming_invoice.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.document_incoming_invoice': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - document_incoming_invoice = trytond.modules.document_incoming_invoice - """, # noqa: E501 - ) diff --git a/modules/document_incoming_invoice/tox.ini b/modules/document_incoming_invoice/tox.ini index 53e3ce4cf0..49fba3f117 100644 --- a/modules/document_incoming_invoice/tox.ini +++ b/modules/document_incoming_invoice/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.document_incoming_invoice --omit=*/tests/* -m xmlrunner discover -s trytond.modules.document_incoming_invoice {posargs} commands_post = coverage report coverage xml diff --git a/modules/document_incoming_ocr/COPYRIGHT b/modules/document_incoming_ocr/COPYRIGHT index 4a054c0870..755de76340 100644 --- a/modules/document_incoming_ocr/COPYRIGHT +++ b/modules/document_incoming_ocr/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2023-2025 B2CK -Copyright (C) 2023-2025 Cédric Krier +Copyright (C) 2023-2025 B2CK SRL +Copyright (C) 2023-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/document_incoming_ocr/MANIFEST.in b/modules/document_incoming_ocr/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/document_incoming_ocr/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/document_incoming_ocr/doc/conf.py b/modules/document_incoming_ocr/doc/conf.py index 627063fab7..ed2b1b264a 100644 --- a/modules/document_incoming_ocr/doc/conf.py +++ b/modules/document_incoming_ocr/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/document_incoming_ocr/doc/requirements-doc.txt b/modules/document_incoming_ocr/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/document_incoming_ocr/doc/requirements-doc.txt +++ b/modules/document_incoming_ocr/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/document_incoming_ocr/pyproject.toml b/modules/document_incoming_ocr/pyproject.toml new file mode 100644 index 0000000000..d36e4a3de0 --- /dev/null +++ b/modules/document_incoming_ocr/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_document_incoming_ocr' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "OCR for incoming document in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "incoming document", "OCR"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +document_incoming_ocr = 'trytond.modules.document_incoming_ocr' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-document-incoming-ocr/" +changelog = "https://docs.tryton.org/modules-document-incoming-ocr/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/document_incoming_ocr" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/document_incoming_ocr/setup.py b/modules/document_incoming_ocr/setup.py deleted file mode 100755 index b4669b4db5..0000000000 --- a/modules/document_incoming_ocr/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_document_incoming_ocr' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to process incoming document with OCR', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-document-incoming-ocr'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton document incoming OCR', - package_dir={'trytond.modules.document_incoming_ocr': '.'}, - packages=( - ['trytond.modules.document_incoming_ocr'] - + ['trytond.modules.document_incoming_ocr.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.document_incoming_ocr': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - document_incoming_ocr = trytond.modules.document_incoming_ocr - """, # noqa: E501 - ) diff --git a/modules/document_incoming_ocr/tox.ini b/modules/document_incoming_ocr/tox.ini index 53e3ce4cf0..1107f30101 100644 --- a/modules/document_incoming_ocr/tox.ini +++ b/modules/document_incoming_ocr/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.document_incoming_ocr --omit=*/tests/* -m xmlrunner discover -s trytond.modules.document_incoming_ocr {posargs} commands_post = coverage report coverage xml diff --git a/modules/document_incoming_ocr_typless/COPYRIGHT b/modules/document_incoming_ocr_typless/COPYRIGHT index 4a054c0870..755de76340 100644 --- a/modules/document_incoming_ocr_typless/COPYRIGHT +++ b/modules/document_incoming_ocr_typless/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2023-2025 B2CK -Copyright (C) 2023-2025 Cédric Krier +Copyright (C) 2023-2025 B2CK SRL +Copyright (C) 2023-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/document_incoming_ocr_typless/MANIFEST.in b/modules/document_incoming_ocr_typless/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/document_incoming_ocr_typless/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/document_incoming_ocr_typless/doc/conf.py b/modules/document_incoming_ocr_typless/doc/conf.py index bbb5dbb54c..adf0871e8e 100644 --- a/modules/document_incoming_ocr_typless/doc/conf.py +++ b/modules/document_incoming_ocr_typless/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/document_incoming_ocr_typless/doc/requirements-doc.txt b/modules/document_incoming_ocr_typless/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/document_incoming_ocr_typless/doc/requirements-doc.txt +++ b/modules/document_incoming_ocr_typless/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/document_incoming_ocr_typless/pyproject.toml b/modules/document_incoming_ocr_typless/pyproject.toml new file mode 100644 index 0000000000..cdd9ada422 --- /dev/null +++ b/modules/document_incoming_ocr_typless/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_document_incoming_ocr_typless' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Typless OCR for incoming document in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "incoming document", "OCR"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +document_incoming_ocr_typless = 'trytond.modules.document_incoming_ocr_typless' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-document-incoming-ocr-typless/" +changelog = "https://docs.tryton.org/modules-document-incoming-ocr-typless/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.pdf', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/document_incoming_ocr_typless" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['requests'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/document_incoming_ocr_typless/setup.py b/modules/document_incoming_ocr_typless/setup.py deleted file mode 100755 index dd27b40426..0000000000 --- a/modules/document_incoming_ocr_typless/setup.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_document_incoming_ocr_typless' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['requests'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_document_incoming_invoice'), - ] - -setup(name=name, - version=version, - description=( - 'Tryton module that integrates Typless OCR for incoming document'), - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-document-incoming-ocr-typless'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton document incoming OCR Typless', - package_dir={'trytond.modules.document_incoming_ocr_typless': '.'}, - packages=( - ['trytond.modules.document_incoming_ocr_typless'] - + ['trytond.modules.document_incoming_ocr_typless.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.document_incoming_ocr_typless': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.pdf']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - document_incoming_ocr_typless = trytond.modules.document_incoming_ocr_typless - """, # noqa: E501 - ) diff --git a/modules/document_incoming_ocr_typless/tox.ini b/modules/document_incoming_ocr_typless/tox.ini index 53e3ce4cf0..54140c9ac4 100644 --- a/modules/document_incoming_ocr_typless/tox.ini +++ b/modules/document_incoming_ocr_typless/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.document_incoming_ocr_typless --omit=*/tests/* -m xmlrunner discover -s trytond.modules.document_incoming_ocr_typless {posargs} commands_post = coverage report coverage xml diff --git a/modules/edocument_peppol/COPYRIGHT b/modules/edocument_peppol/COPYRIGHT index 2501b17849..31768e0214 100644 --- a/modules/edocument_peppol/COPYRIGHT +++ b/modules/edocument_peppol/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2025 Cédric Krier +Copyright (C) 2025 Cédric Krier +Copyright (C) 2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/edocument_peppol/MANIFEST.in b/modules/edocument_peppol/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/edocument_peppol/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/edocument_peppol/doc/conf.py b/modules/edocument_peppol/doc/conf.py index 2fad16d111..60066ac7d2 100644 --- a/modules/edocument_peppol/doc/conf.py +++ b/modules/edocument_peppol/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/edocument_peppol/doc/requirements-doc.txt b/modules/edocument_peppol/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/edocument_peppol/doc/requirements-doc.txt +++ b/modules/edocument_peppol/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/edocument_peppol/pyproject.toml b/modules/edocument_peppol/pyproject.toml new file mode 100644 index 0000000000..c222514a91 --- /dev/null +++ b/modules/edocument_peppol/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_edocument_peppol' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Electronic document via Peppol in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "edocument", "peppol"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +edocument_peppol = 'trytond.modules.edocument_peppol' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-edocument-peppol/" +changelog = "https://docs.tryton.org/modules-edocument-peppol/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/edocument_peppol" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/edocument_peppol/setup.py b/modules/edocument_peppol/setup.py deleted file mode 100755 index 40b3f9543e..0000000000 --- a/modules/edocument_peppol/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_edocument_peppol' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to exchange electronic document via Peppol', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-edocument-peppol'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton electronic document peppol', - package_dir={'trytond.modules.edocument_peppol': '.'}, - packages=( - ['trytond.modules.edocument_peppol'] - + ['trytond.modules.edocument_peppol.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.edocument_peppol': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - edocument_peppol = trytond.modules.edocument_peppol - """, # noqa: E501 - ) diff --git a/modules/edocument_peppol/tox.ini b/modules/edocument_peppol/tox.ini index 53e3ce4cf0..ecd3cb8c18 100644 --- a/modules/edocument_peppol/tox.ini +++ b/modules/edocument_peppol/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.edocument_peppol --omit=*/tests/* -m xmlrunner discover -s trytond.modules.edocument_peppol {posargs} commands_post = coverage report coverage xml diff --git a/modules/edocument_peppol_peppyrus/COPYRIGHT b/modules/edocument_peppol_peppyrus/COPYRIGHT index 2501b17849..31768e0214 100644 --- a/modules/edocument_peppol_peppyrus/COPYRIGHT +++ b/modules/edocument_peppol_peppyrus/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2025 Cédric Krier +Copyright (C) 2025 Cédric Krier +Copyright (C) 2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/edocument_peppol_peppyrus/MANIFEST.in b/modules/edocument_peppol_peppyrus/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/edocument_peppol_peppyrus/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/edocument_peppol_peppyrus/doc/conf.py b/modules/edocument_peppol_peppyrus/doc/conf.py index 7ca4bbf447..6a3f6cfbae 100644 --- a/modules/edocument_peppol_peppyrus/doc/conf.py +++ b/modules/edocument_peppol_peppyrus/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/edocument_peppol_peppyrus/doc/requirements-doc.txt b/modules/edocument_peppol_peppyrus/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/edocument_peppol_peppyrus/doc/requirements-doc.txt +++ b/modules/edocument_peppol_peppyrus/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/edocument_peppol_peppyrus/pyproject.toml b/modules/edocument_peppol_peppyrus/pyproject.toml new file mode 100644 index 0000000000..966966a4b1 --- /dev/null +++ b/modules/edocument_peppol_peppyrus/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_edocument_peppol_peppyrus' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Peppyrus as Peppol access point for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "edocument", "peppol"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +edocument_peppol_peppyrus = 'trytond.modules.edocument_peppol_peppyrus' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-edocument-peppol-peppyrus/" +changelog = "https://docs.tryton.org/modules-edocument-peppol-peppyrus/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.xml', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/edocument_peppol_peppyrus" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'lxml', + 'requests', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/edocument_peppol_peppyrus/setup.py b/modules/edocument_peppol_peppyrus/setup.py deleted file mode 100755 index 53f6b577aa..0000000000 --- a/modules/edocument_peppol_peppyrus/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_edocument_peppol_peppyrus' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['requests', 'lxml'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to use Peppyrus as access point to Peppol', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-edocument-peppol-peppyrus'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton electronic document peppol peppyrus', - package_dir={'trytond.modules.edocument_peppol_peppyrus': '.'}, - packages=( - ['trytond.modules.edocument_peppol_peppyrus'] - + ['trytond.modules.edocument_peppol_peppyrus.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.edocument_peppol_peppyrus': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json', 'tests/*.xml']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - edocument_peppol_peppyrus = trytond.modules.edocument_peppol_peppyrus - """, # noqa: E501 - ) diff --git a/modules/edocument_peppol_peppyrus/tox.ini b/modules/edocument_peppol_peppyrus/tox.ini index 53e3ce4cf0..a254c0a195 100644 --- a/modules/edocument_peppol_peppyrus/tox.ini +++ b/modules/edocument_peppol_peppyrus/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.edocument_peppol_peppyrus --omit=*/tests/* -m xmlrunner discover -s trytond.modules.edocument_peppol_peppyrus {posargs} commands_post = coverage report coverage xml diff --git a/modules/edocument_ubl/COPYRIGHT b/modules/edocument_ubl/COPYRIGHT index 2501b17849..31768e0214 100644 --- a/modules/edocument_ubl/COPYRIGHT +++ b/modules/edocument_ubl/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2025 Cédric Krier +Copyright (C) 2025 Cédric Krier +Copyright (C) 2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/edocument_ubl/MANIFEST.in b/modules/edocument_ubl/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/edocument_ubl/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/edocument_ubl/doc/conf.py b/modules/edocument_ubl/doc/conf.py index 1745a10369..ecf26d6e2c 100644 --- a/modules/edocument_ubl/doc/conf.py +++ b/modules/edocument_ubl/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/edocument_ubl/doc/requirements-doc.txt b/modules/edocument_ubl/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/edocument_ubl/doc/requirements-doc.txt +++ b/modules/edocument_ubl/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/edocument_ubl/pyproject.toml b/modules/edocument_ubl/pyproject.toml new file mode 100644 index 0000000000..0c4dc36d92 --- /dev/null +++ b/modules/edocument_ubl/pyproject.toml @@ -0,0 +1,66 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_edocument_ubl' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "UBL electronic document for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "edocument", "UBL", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +edocument_ubl = 'trytond.modules.edocument_ubl' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-edocument-ubl/" +changelog = "https://docs.tryton.org/modules-edocument-ubl/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'template/**/*.xml', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.xsd', + 'tests/**/*.xml', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/edocument_ubl" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'Genshi', + 'lxml', + 'python-stdnum', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/edocument_ubl/setup.py b/modules/edocument_ubl/setup.py deleted file mode 100755 index 4bcc04eda1..0000000000 --- a/modules/edocument_ubl/setup.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_edocument_ubl' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['Genshi', 'lxml', 'python-stdnum'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_cash_rounding'), - get_require_version('trytond_account_invoice'), - get_require_version('trytond_bank'), - get_require_version('trytond_document_incoming_invoice'), - get_require_version('trytond_purchase'), - get_require_version('trytond_sale'), - ] - -setup(name=name, - version=version, - description='Tryton module for electronic document UBL', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-edocument-ubl'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton electronic document UBL', - package_dir={'trytond.modules.edocument_ubl': '.'}, - packages=( - ['trytond.modules.edocument_ubl'] - + ['trytond.modules.edocument_ubl.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.edocument_ubl': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'template/*/*.xml', 'tests/*/*/*.xsq', - 'tests/*.rst', 'tests/*.json', 'tests/*.xml']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - edocument_ubl = trytond.modules.edocument_ubl - """, # noqa: E501 - ) diff --git a/modules/edocument_ubl/tox.ini b/modules/edocument_ubl/tox.ini index 53e3ce4cf0..cb36097702 100644 --- a/modules/edocument_ubl/tox.ini +++ b/modules/edocument_ubl/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.edocument_ubl --omit=*/tests/* -m xmlrunner discover -s trytond.modules.edocument_ubl {posargs} commands_post = coverage report coverage xml diff --git a/modules/edocument_uncefact/COPYRIGHT b/modules/edocument_uncefact/COPYRIGHT index 3655bc4251..7fe447c110 100644 --- a/modules/edocument_uncefact/COPYRIGHT +++ b/modules/edocument_uncefact/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2018-2025 Cédric Krier -Copyright (C) 2018-2025 B2CK +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/edocument_uncefact/MANIFEST.in b/modules/edocument_uncefact/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/edocument_uncefact/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/edocument_uncefact/doc/conf.py b/modules/edocument_uncefact/doc/conf.py index 2b24192589..1dd09c3434 100644 --- a/modules/edocument_uncefact/doc/conf.py +++ b/modules/edocument_uncefact/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/edocument_uncefact/doc/requirements-doc.txt b/modules/edocument_uncefact/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/edocument_uncefact/doc/requirements-doc.txt +++ b/modules/edocument_uncefact/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/edocument_uncefact/pyproject.toml b/modules/edocument_uncefact/pyproject.toml new file mode 100644 index 0000000000..4f56657ff8 --- /dev/null +++ b/modules/edocument_uncefact/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_edocument_uncefact' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "UN/CEFACT electronic document for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "edocument", "UNCEFACT", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +edocument_uncefact = 'trytond.modules.edocument_uncefact' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-edocument-uncefact/" +changelog = "https://docs.tryton.org/modules-edocument-uncefact/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.xsd', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/edocument_uncefact" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['Genshi'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.optional-dependencies] +test = ['lxml'] + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/edocument_uncefact/setup.py b/modules/edocument_uncefact/setup.py deleted file mode 100755 index 9b443e6b52..0000000000 --- a/modules/edocument_uncefact/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_edocument_uncefact' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['Genshi'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - 'lxml', - get_require_version('trytond_account_invoice'), - ] - -setup(name=name, - version=version, - description='Tryton module for electronic document UN/CEFACT', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-edocument-uncefact'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton electronic document UN/CEFACT UNECE', - package_dir={'trytond.modules.edocument_uncefact': '.'}, - packages=( - ['trytond.modules.edocument_uncefact'] - + ['trytond.modules.edocument_uncefact.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.edocument_uncefact': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'template/*/*.xml', 'tests/*/*/*/*.xsd', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - edocument_uncefact = trytond.modules.edocument_uncefact - """, - ) diff --git a/modules/edocument_uncefact/tox.ini b/modules/edocument_uncefact/tox.ini index 53e3ce4cf0..b1f9cf2035 100644 --- a/modules/edocument_uncefact/tox.ini +++ b/modules/edocument_uncefact/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.edocument_uncefact --omit=*/tests/* -m xmlrunner discover -s trytond.modules.edocument_uncefact {posargs} commands_post = coverage report coverage xml diff --git a/modules/edocument_unece/COPYRIGHT b/modules/edocument_unece/COPYRIGHT index 3655bc4251..7fe447c110 100644 --- a/modules/edocument_unece/COPYRIGHT +++ b/modules/edocument_unece/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2018-2025 Cédric Krier -Copyright (C) 2018-2025 B2CK +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/edocument_unece/MANIFEST.in b/modules/edocument_unece/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/edocument_unece/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/edocument_unece/doc/conf.py b/modules/edocument_unece/doc/conf.py index e2b3f8c25d..cebd711a9f 100644 --- a/modules/edocument_unece/doc/conf.py +++ b/modules/edocument_unece/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/edocument_unece/doc/requirements-doc.txt b/modules/edocument_unece/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/edocument_unece/doc/requirements-doc.txt +++ b/modules/edocument_unece/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/edocument_unece/pyproject.toml b/modules/edocument_unece/pyproject.toml new file mode 100644 index 0000000000..ba2c99ee8c --- /dev/null +++ b/modules/edocument_unece/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_edocument_unece' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "UNECE codes for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "edocument", "UNECE"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +edocument_unece = 'trytond.modules.edocument_unece' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-edocument-unece/" +changelog = "https://docs.tryton.org/modules-edocument-unece/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/edocument_unece" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/edocument_unece/setup.py b/modules/edocument_unece/setup.py deleted file mode 100755 index 7e13da7739..0000000000 --- a/modules/edocument_unece/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_edocument_unece' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module for electronic document UNECE codes', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-edocument-unece'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton UNECE', - package_dir={'trytond.modules.edocument_unece': '.'}, - packages=( - ['trytond.modules.edocument_unece'] - + ['trytond.modules.edocument_unece.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.edocument_unece': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - edocument_unece = trytond.modules.edocument_unece - """, - ) diff --git a/modules/edocument_unece/tox.ini b/modules/edocument_unece/tox.ini index 53e3ce4cf0..60b73dbe8a 100644 --- a/modules/edocument_unece/tox.ini +++ b/modules/edocument_unece/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.edocument_unece --omit=*/tests/* -m xmlrunner discover -s trytond.modules.edocument_unece {posargs} commands_post = coverage report coverage xml diff --git a/modules/google_maps/COPYRIGHT b/modules/google_maps/COPYRIGHT index f9702c30ca..bfecfa3ea1 100644 --- a/modules/google_maps/COPYRIGHT +++ b/modules/google_maps/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2012 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2012 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/google_maps/MANIFEST.in b/modules/google_maps/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/google_maps/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/google_maps/doc/conf.py b/modules/google_maps/doc/conf.py index 8eb6e48b08..055de55a91 100644 --- a/modules/google_maps/doc/conf.py +++ b/modules/google_maps/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/google_maps/doc/requirements-doc.txt b/modules/google_maps/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/google_maps/doc/requirements-doc.txt +++ b/modules/google_maps/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/google_maps/pyproject.toml b/modules/google_maps/pyproject.toml new file mode 100644 index 0000000000..7628be88e3 --- /dev/null +++ b/modules/google_maps/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_google_maps' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Google Maps link for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "map"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +google_maps = 'trytond.modules.google_maps' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-google-maps/" +changelog = "https://docs.tryton.org/modules-google-maps/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/google_maps" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/google_maps/setup.py b/modules/google_maps/setup.py deleted file mode 100755 index c91a966d5d..0000000000 --- a/modules/google_maps/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_google_maps' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to link addresses to Google Maps', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-google-maps', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton google maps', - package_dir={'trytond.modules.google_maps': '.'}, - packages=( - ['trytond.modules.google_maps'] - + ['trytond.modules.google_maps.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.google_maps': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - google_maps = trytond.modules.google_maps - """, - ) diff --git a/modules/google_maps/tox.ini b/modules/google_maps/tox.ini index 53e3ce4cf0..94c0ee9969 100644 --- a/modules/google_maps/tox.ini +++ b/modules/google_maps/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.google_maps --omit=*/tests/* -m xmlrunner discover -s trytond.modules.google_maps {posargs} commands_post = coverage report coverage xml diff --git a/modules/inbound_email/COPYRIGHT b/modules/inbound_email/COPYRIGHT index 4a054c0870..755de76340 100644 --- a/modules/inbound_email/COPYRIGHT +++ b/modules/inbound_email/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2023-2025 B2CK -Copyright (C) 2023-2025 Cédric Krier +Copyright (C) 2023-2025 B2CK SRL +Copyright (C) 2023-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/inbound_email/MANIFEST.in b/modules/inbound_email/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/inbound_email/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/inbound_email/doc/conf.py b/modules/inbound_email/doc/conf.py index 7ddc1090a5..e47c5fade0 100644 --- a/modules/inbound_email/doc/conf.py +++ b/modules/inbound_email/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/inbound_email/doc/requirements-doc.txt b/modules/inbound_email/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/inbound_email/doc/requirements-doc.txt +++ b/modules/inbound_email/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/inbound_email/pyproject.toml b/modules/inbound_email/pyproject.toml new file mode 100644 index 0000000000..03b749b893 --- /dev/null +++ b/modules/inbound_email/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_inbound_email' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Inbound email for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "email"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +inbound_email = 'trytond.modules.inbound_email' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-inbound-email/" +changelog = "https://docs.tryton.org/modules-inbound-email/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/inbound_email" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/inbound_email/setup.py b/modules/inbound_email/setup.py deleted file mode 100755 index 60fb27894e..0000000000 --- a/modules/inbound_email/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_inbound_email' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to manage inbound email', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-inbound-email'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton inbound email', - package_dir={'trytond.modules.inbound_email': '.'}, - packages=( - ['trytond.modules.inbound_email'] - + ['trytond.modules.inbound_email.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.inbound_email': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - inbound_email = trytond.modules.inbound_email - """, # noqa: E501 - ) diff --git a/modules/inbound_email/tox.ini b/modules/inbound_email/tox.ini index 53e3ce4cf0..2d2b4afffc 100644 --- a/modules/inbound_email/tox.ini +++ b/modules/inbound_email/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.inbound_email --omit=*/tests/* -m xmlrunner discover -s trytond.modules.inbound_email {posargs} commands_post = coverage report coverage xml diff --git a/modules/incoterm/COPYRIGHT b/modules/incoterm/COPYRIGHT index 26cedee5ea..83cca03ba3 100644 --- a/modules/incoterm/COPYRIGHT +++ b/modules/incoterm/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/incoterm/MANIFEST.in b/modules/incoterm/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/incoterm/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/incoterm/doc/conf.py b/modules/incoterm/doc/conf.py index 85eaf4a753..751e1744cf 100644 --- a/modules/incoterm/doc/conf.py +++ b/modules/incoterm/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/incoterm/doc/requirements-doc.txt b/modules/incoterm/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/incoterm/doc/requirements-doc.txt +++ b/modules/incoterm/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/incoterm/pyproject.toml b/modules/incoterm/pyproject.toml new file mode 100644 index 0000000000..1dd9501ef4 --- /dev/null +++ b/modules/incoterm/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_incoterm' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Incoterms for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "incoterm"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +incoterm = 'trytond.modules.incoterm' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-incoterm/" +changelog = "https://docs.tryton.org/modules-incoterm/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/incoterm" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/incoterm/setup.py b/modules/incoterm/setup.py deleted file mode 100755 index 19d1b81156..0000000000 --- a/modules/incoterm/setup.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_incoterm' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account'), - get_require_version('trytond_account_invoice'), - get_require_version('trytond_account_invoice_stock'), - get_require_version('trytond_carrier'), - get_require_version('trytond_purchase'), - get_require_version('trytond_purchase_request_quotation'), - get_require_version('trytond_sale'), - get_require_version('trytond_sale_shipment_cost'), - get_require_version('trytond_sale_opportunity'), - get_require_version('trytond_sale_shipment_grouping'), - get_require_version('trytond_stock'), - get_require_version('trytond_web_shop'), - ] - -setup(name=name, - version=version, - description='Tryton module for incoterms', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-incoterm/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton incoterm', - package_dir={'trytond.modules.incoterm': '.'}, - packages=( - ['trytond.modules.incoterm'] - + ['trytond.modules.incoterm.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.incoterm': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - incoterm = trytond.modules.incoterm - """, # noqa: E501 - ) diff --git a/modules/incoterm/tox.ini b/modules/incoterm/tox.ini index 53e3ce4cf0..9ed4122c68 100644 --- a/modules/incoterm/tox.ini +++ b/modules/incoterm/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.incoterm --omit=*/tests/* -m xmlrunner discover -s trytond.modules.incoterm {posargs} commands_post = coverage report coverage xml diff --git a/modules/ldap_authentication/COPYRIGHT b/modules/ldap_authentication/COPYRIGHT index d93b54fbc8..a48d948a98 100644 --- a/modules/ldap_authentication/COPYRIGHT +++ b/modules/ldap_authentication/COPYRIGHT @@ -1,8 +1,8 @@ -Copyright (C) 2006-2025 Cédric Krier. -Copyright (C) 2009-2012 Bertrand Chenal. -Copyright (C) 2009-2025 B2CK SPRL. -Copyright (C) 2008-2025 Udo Spallek. -Copyright (C) 2008-2011 virtual things. +Copyright (C) 2006-2025 Cédric Krier +Copyright (C) 2009-2012 Bertrand Chenal +Copyright (C) 2009-2025 B2CK SRL +Copyright (C) 2008-2025 Udo Spallek +Copyright (C) 2008-2011 virtual things This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/ldap_authentication/MANIFEST.in b/modules/ldap_authentication/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/ldap_authentication/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/ldap_authentication/doc/conf.py b/modules/ldap_authentication/doc/conf.py index f79fdd9ecd..56ce8c0466 100644 --- a/modules/ldap_authentication/doc/conf.py +++ b/modules/ldap_authentication/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/ldap_authentication/doc/requirements-doc.txt b/modules/ldap_authentication/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/ldap_authentication/doc/requirements-doc.txt +++ b/modules/ldap_authentication/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/ldap_authentication/pyproject.toml b/modules/ldap_authentication/pyproject.toml new file mode 100644 index 0000000000..d85651d115 --- /dev/null +++ b/modules/ldap_authentication/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_ldap_authentication' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "LDAP authentication for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "authentication", "ldap"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +ldap_authentication = 'trytond.modules.ldap_authentication' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-ldap-authentication/" +changelog = "https://docs.tryton.org/modules-ldap-authentication/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/ldap_authentication" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['ldap3 >= 2.0.7'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/ldap_authentication/setup.py b/modules/ldap_authentication/setup.py deleted file mode 100755 index 9be5ebcb10..0000000000 --- a/modules/ldap_authentication/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_ldap_authentication' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['ldap3 >= 2.0.7'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to authenticate users through LDAP', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton ldap authentication', - package_dir={'trytond.modules.ldap_authentication': '.'}, - packages=( - ['trytond.modules.ldap_authentication'] - + ['trytond.modules.ldap_authentication.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.ldap_authentication': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ('Topic :: System :: Systems Administration ' - ':: Authentication/Directory :: LDAP'), - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - ldap_authentication = trytond.modules.ldap_authentication - """, - ) diff --git a/modules/ldap_authentication/tox.ini b/modules/ldap_authentication/tox.ini index 53e3ce4cf0..617b3332cc 100644 --- a/modules/ldap_authentication/tox.ini +++ b/modules/ldap_authentication/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.ldap_authentication --omit=*/tests/* -m xmlrunner discover -s trytond.modules.ldap_authentication {posargs} commands_post = coverage report coverage xml diff --git a/modules/marketing/COPYRIGHT b/modules/marketing/COPYRIGHT index 9bb4210eea..a6f13c69ad 100644 --- a/modules/marketing/COPYRIGHT +++ b/modules/marketing/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2018-2025 B2CK -Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL +Copyright (C) 2018-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/marketing/MANIFEST.in b/modules/marketing/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/marketing/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/marketing/doc/conf.py b/modules/marketing/doc/conf.py index f2a4bd8778..bfe277c568 100644 --- a/modules/marketing/doc/conf.py +++ b/modules/marketing/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/marketing/doc/requirements-doc.txt b/modules/marketing/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/marketing/doc/requirements-doc.txt +++ b/modules/marketing/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/marketing/pyproject.toml b/modules/marketing/pyproject.toml new file mode 100644 index 0000000000..1ee4b6c45b --- /dev/null +++ b/modules/marketing/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_marketing' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Marketing for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "marketing"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +marketing = 'trytond.modules.marketing' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-marketing/" +changelog = "https://docs.tryton.org/modules-marketing/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/marketing" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/marketing/setup.py b/modules/marketing/setup.py deleted file mode 100755 index f05104e493..0000000000 --- a/modules/marketing/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_marketing' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to group marketing features', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-marketing', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton marketing', - package_dir={'trytond.modules.marketing': '.'}, - packages=( - ['trytond.modules.marketing'] - + ['trytond.modules.marketing.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.marketing': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - marketing = trytond.modules.marketing - """, - ) diff --git a/modules/marketing/tox.ini b/modules/marketing/tox.ini index 53e3ce4cf0..c30d172931 100644 --- a/modules/marketing/tox.ini +++ b/modules/marketing/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.marketing --omit=*/tests/* -m xmlrunner discover -s trytond.modules.marketing {posargs} commands_post = coverage report coverage xml diff --git a/modules/marketing_automation/COPYRIGHT b/modules/marketing_automation/COPYRIGHT index 3aa546ac65..8ee75e609c 100644 --- a/modules/marketing_automation/COPYRIGHT +++ b/modules/marketing_automation/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2018-2025 B2CK -Copyright (C) 2018-2025 Cédric Krier -Copyright (C) 2018-2019 Nicolas Êvrard +Copyright (C) 2018-2025 B2CK SRL +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2019 Nicolas Êvrard This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/marketing_automation/MANIFEST.in b/modules/marketing_automation/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/marketing_automation/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/marketing_automation/doc/conf.py b/modules/marketing_automation/doc/conf.py index 4d12343b49..88171e0447 100644 --- a/modules/marketing_automation/doc/conf.py +++ b/modules/marketing_automation/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/marketing_automation/doc/requirements-doc.txt b/modules/marketing_automation/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/marketing_automation/doc/requirements-doc.txt +++ b/modules/marketing_automation/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/marketing_automation/pyproject.toml b/modules/marketing_automation/pyproject.toml new file mode 100644 index 0000000000..894365302e --- /dev/null +++ b/modules/marketing_automation/pyproject.toml @@ -0,0 +1,65 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_marketing_automation' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Marketing automation for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "marketing"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +marketing_automation = 'trytond.modules.marketing_automation' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-marketing-automation/" +changelog = "https://docs.tryton.org/modules-marketing-automation/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + '**/*.html', + '**/*.gif', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.html', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/marketing_automation" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'Genshi', + 'python-dateutil', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/marketing_automation/setup.py b/modules/marketing_automation/setup.py deleted file mode 100755 index fa31db0f1a..0000000000 --- a/modules/marketing_automation/setup.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_marketing_automation' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['Genshi', 'python-dateutil'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale'), - ] - -setup(name=name, - version=version, - description='Tryton module to plan, ' - 'coordinate and manage marketing campaigns', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-marketing-automation'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton marketing automation', - package_dir={'trytond.modules.marketing_automation': '.'}, - packages=( - ['trytond.modules.marketing_automation'] - + ['trytond.modules.marketing_automation.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.marketing_automation': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', '*.html', '*.gif', 'tests/*.rst', - 'tests/*.html']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - marketing_automation = trytond.modules.marketing_automation - """, - ) diff --git a/modules/marketing_automation/tox.ini b/modules/marketing_automation/tox.ini index 53e3ce4cf0..764f9212bb 100644 --- a/modules/marketing_automation/tox.ini +++ b/modules/marketing_automation/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.marketing_automation --omit=*/tests/* -m xmlrunner discover -s trytond.modules.marketing_automation {posargs} commands_post = coverage report coverage xml diff --git a/modules/marketing_campaign/COPYRIGHT b/modules/marketing_campaign/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/marketing_campaign/COPYRIGHT +++ b/modules/marketing_campaign/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/marketing_campaign/MANIFEST.in b/modules/marketing_campaign/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/marketing_campaign/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/marketing_campaign/doc/conf.py b/modules/marketing_campaign/doc/conf.py index e281ffeb71..104428dfb8 100644 --- a/modules/marketing_campaign/doc/conf.py +++ b/modules/marketing_campaign/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/marketing_campaign/doc/requirements-doc.txt b/modules/marketing_campaign/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/marketing_campaign/doc/requirements-doc.txt +++ b/modules/marketing_campaign/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/marketing_campaign/pyproject.toml b/modules/marketing_campaign/pyproject.toml new file mode 100644 index 0000000000..b6480cd146 --- /dev/null +++ b/modules/marketing_campaign/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_marketing_campaign' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Marketing campaign for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "marketing"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +marketing_campaign = 'trytond.modules.marketing_campaign' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-marketing-campaign/" +changelog = "https://docs.tryton.org/modules-marketing-campaign/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/marketing_campaign" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/marketing_campaign/setup.py b/modules/marketing_campaign/setup.py deleted file mode 100755 index 82d80da85b..0000000000 --- a/modules/marketing_campaign/setup.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_marketing_campaign' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_marketing_email'), - get_require_version('trytond_marketing_automation'), - get_require_version('trytond_sale'), - get_require_version('trytond_sale_opportunity'), - get_require_version('trytond_sale_point'), - get_require_version('trytond_web_shortener'), - ] - -setup(name=name, - version=version, - description='Tryton module to manage marketing campaign', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-marketing-campaign'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton marketing campaign sale UTM', - package_dir={'trytond.modules.marketing_campaign': '.'}, - packages=( - ['trytond.modules.marketing_campaign'] - + ['trytond.modules.marketing_campaign.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.marketing_campaign': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - marketing_campaign = trytond.modules.marketing_campaign - """, # noqa: E501 - ) diff --git a/modules/marketing_campaign/tox.ini b/modules/marketing_campaign/tox.ini index 53e3ce4cf0..542dbbed77 100644 --- a/modules/marketing_campaign/tox.ini +++ b/modules/marketing_campaign/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.marketing_campaign --omit=*/tests/* -m xmlrunner discover -s trytond.modules.marketing_campaign {posargs} commands_post = coverage report coverage xml diff --git a/modules/marketing_email/COPYRIGHT b/modules/marketing_email/COPYRIGHT index 314329591e..7687d6e45d 100644 --- a/modules/marketing_email/COPYRIGHT +++ b/modules/marketing_email/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2018 Sergi Almacellas Abellana -Copyright (C) 2017-2025 Cédric Krier -Copyright (C) 2017-2025 B2CK +Copyright (C) 2018 Sergi Almacellas Abellana +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/marketing_email/MANIFEST.in b/modules/marketing_email/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/marketing_email/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/marketing_email/doc/conf.py b/modules/marketing_email/doc/conf.py index a5984496ce..373aaa592f 100644 --- a/modules/marketing_email/doc/conf.py +++ b/modules/marketing_email/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/marketing_email/doc/requirements-doc.txt b/modules/marketing_email/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/marketing_email/doc/requirements-doc.txt +++ b/modules/marketing_email/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/marketing_email/pyproject.toml b/modules/marketing_email/pyproject.toml new file mode 100644 index 0000000000..8d90bcec58 --- /dev/null +++ b/modules/marketing_email/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_marketing_email' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Marketing mailing lists for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "marketing"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +marketing_email = 'trytond.modules.marketing_email' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-marketing-email/" +changelog = "https://docs.tryton.org/modules-marketing-email/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + '**/*.html', + '**/*.gif', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/marketing_email" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/marketing_email/setup.py b/modules/marketing_email/setup.py deleted file mode 100755 index cf6fd8d315..0000000000 --- a/modules/marketing_email/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_marketing_email' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to manage marketing mailing lists', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-marketing-email'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton marketing email list', - package_dir={'trytond.modules.marketing_email': '.'}, - packages=( - ['trytond.modules.marketing_email'] - + ['trytond.modules.marketing_email.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.marketing_email': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', '*.html', - '*.gif', 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - marketing_email = trytond.modules.marketing_email - """, - ) diff --git a/modules/marketing_email/tox.ini b/modules/marketing_email/tox.ini index 53e3ce4cf0..ed60264265 100644 --- a/modules/marketing_email/tox.ini +++ b/modules/marketing_email/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.marketing_email --omit=*/tests/* -m xmlrunner discover -s trytond.modules.marketing_email {posargs} commands_post = coverage report coverage xml diff --git a/modules/notification_email/COPYRIGHT b/modules/notification_email/COPYRIGHT index dc39f75056..a0f610cf73 100644 --- a/modules/notification_email/COPYRIGHT +++ b/modules/notification_email/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2016-2022 Sergi Almacellas Abellana -Copyright (C) 2017-2025 Cédric Krier -Copyright (C) 2017-2025 B2CK +Copyright (C) 2016-2022 Sergi Almacellas Abellana +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/notification_email/MANIFEST.in b/modules/notification_email/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/notification_email/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/notification_email/doc/conf.py b/modules/notification_email/doc/conf.py index 0f52400012..65d7fcb13e 100644 --- a/modules/notification_email/doc/conf.py +++ b/modules/notification_email/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/notification_email/doc/requirements-doc.txt b/modules/notification_email/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/notification_email/doc/requirements-doc.txt +++ b/modules/notification_email/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/notification_email/pyproject.toml b/modules/notification_email/pyproject.toml new file mode 100644 index 0000000000..d26ec06076 --- /dev/null +++ b/modules/notification_email/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_notification_email' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Email notification for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "email"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +notification_email = 'trytond.modules.notification_email' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-notification-email/" +changelog = "https://docs.tryton.org/modules-notification-email/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/notification_email" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'Genshi', + 'python-sql', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/notification_email/setup.py b/modules/notification_email/setup.py deleted file mode 100755 index 0f7223d871..0000000000 --- a/modules/notification_email/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_notification_email' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['Genshi', 'python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('trytond_company'), - get_require_version('trytond_commission'), - get_require_version('trytond_party'), - get_require_version('trytond_web_user'), - ] - -setup(name=name, - version=version, - description='Tryton module for sending email notifications', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-notification-email', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton email notification', - package_dir={'trytond.modules.notification_email': '.'}, - packages=( - ['trytond.modules.notification_email'] - + ['trytond.modules.notification_email.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.notification_email': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - notification_email = trytond.modules.notification_email - """, - ) diff --git a/modules/notification_email/tox.ini b/modules/notification_email/tox.ini index 53e3ce4cf0..ab9040cb11 100644 --- a/modules/notification_email/tox.ini +++ b/modules/notification_email/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.notification_email --omit=*/tests/* -m xmlrunner discover -s trytond.modules.notification_email {posargs} commands_post = coverage report coverage xml diff --git a/modules/party/COPYRIGHT b/modules/party/COPYRIGHT index 7d33e64e86..b60bb839f6 100644 --- a/modules/party/COPYRIGHT +++ b/modules/party/COPYRIGHT @@ -1,10 +1,10 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2008-2025 Udo Spallek. -Copyright (C) 2008-2011 Korbinian Preisler. -Copyright (C) 2008-2011 virtual things. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2008-2025 Udo Spallek +Copyright (C) 2008-2011 Korbinian Preisler +Copyright (C) 2008-2011 virtual things +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/party/MANIFEST.in b/modules/party/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/party/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/party/doc/conf.py b/modules/party/doc/conf.py index 0c91f3440c..43ffe1aeab 100644 --- a/modules/party/doc/conf.py +++ b/modules/party/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/party/doc/requirements-doc.txt b/modules/party/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/party/doc/requirements-doc.txt +++ b/modules/party/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/party/pyproject.toml b/modules/party/pyproject.toml new file mode 100644 index 0000000000..cfb9a6ffd2 --- /dev/null +++ b/modules/party/pyproject.toml @@ -0,0 +1,68 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_party' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Parties and addresses for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "party"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +party = 'trytond.modules.party' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-party/" +changelog = "https://docs.tryton.org/modules-party/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/party" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql >= 0.4', + 'python-stdnum >= 2.2', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.optional-dependencies] +VIES = ['python-stdnum[SOAP]'] +phonenumbers = ['phonenumbers'] +phonenumbers-lite = ['phonenumberslite'] +test = ['phonenumberslite'] + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/party/setup.py b/modules/party/setup.py deleted file mode 100755 index 77d379ea10..0000000000 --- a/modules/party/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_party' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4', 'python-stdnum >= 2.2'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), 'phonenumberslite'] - -setup(name=name, - version=version, - description='Tryton module with parties and addresses', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-party/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton party', - package_dir={'trytond.modules.party': '.'}, - packages=( - ['trytond.modules.party'] - + ['trytond.modules.party.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.party': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - 'VIES': ['python-stdnum[SOAP]'], - 'phonenumbers-lite': ['phonenumberslite'], - 'phonenumbers': ['phonenumbers'], - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - party = trytond.modules.party - """, - ) diff --git a/modules/party/tox.ini b/modules/party/tox.ini index 53e3ce4cf0..36083a1a1e 100644 --- a/modules/party/tox.ini +++ b/modules/party/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.party --omit=*/tests/* -m xmlrunner discover -s trytond.modules.party {posargs} commands_post = coverage report coverage xml diff --git a/modules/party_avatar/COPYRIGHT b/modules/party_avatar/COPYRIGHT index bb6a8a0544..e4a7445742 100644 --- a/modules/party_avatar/COPYRIGHT +++ b/modules/party_avatar/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/party_avatar/MANIFEST.in b/modules/party_avatar/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/party_avatar/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/party_avatar/doc/conf.py b/modules/party_avatar/doc/conf.py index 8f0a000296..ed1e6c885c 100644 --- a/modules/party_avatar/doc/conf.py +++ b/modules/party_avatar/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/party_avatar/doc/requirements-doc.txt b/modules/party_avatar/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/party_avatar/doc/requirements-doc.txt +++ b/modules/party_avatar/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/party_avatar/pyproject.toml b/modules/party_avatar/pyproject.toml new file mode 100644 index 0000000000..2dfb334fb7 --- /dev/null +++ b/modules/party_avatar/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_party_avatar' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Party avatars for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "party"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +party_avatar = 'trytond.modules.party_avatar' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-party-avatar/" +changelog = "https://docs.tryton.org/modules-party-avatar/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/party_avatar" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/party_avatar/setup.py b/modules/party_avatar/setup.py deleted file mode 100755 index 97c23b991f..0000000000 --- a/modules/party_avatar/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_party_avatar' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('trytond_company')] - -setup(name=name, - version=version, - description='Tryton module that adds avatar to parties', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-party-avatar'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton party avatar', - package_dir={'trytond.modules.party_avatar': '.'}, - packages=( - ['trytond.modules.party_avatar'] - + ['trytond.modules.party_avatar.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.party_avatar': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - party_avatar = trytond.modules.party_avatar - """, # noqa: E501 - ) diff --git a/modules/party_avatar/tox.ini b/modules/party_avatar/tox.ini index 53e3ce4cf0..ac7f6e4cd9 100644 --- a/modules/party_avatar/tox.ini +++ b/modules/party_avatar/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.party_avatar --omit=*/tests/* -m xmlrunner discover -s trytond.modules.party_avatar {posargs} commands_post = coverage report coverage xml diff --git a/modules/party_relationship/COPYRIGHT b/modules/party_relationship/COPYRIGHT index 877da08de9..8db8119b62 100644 --- a/modules/party_relationship/COPYRIGHT +++ b/modules/party_relationship/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2013 NaN·tic -Copyright (C) 2014-2025 Cédric Krier. -Copyright (C) 2014-2025 B2CK SPRL. +Copyright (C) 2013 NaN-tic +Copyright (C) 2014-2025 Cédric Krier +Copyright (C) 2014-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/party_relationship/MANIFEST.in b/modules/party_relationship/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/party_relationship/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/party_relationship/doc/conf.py b/modules/party_relationship/doc/conf.py index 28893fe749..8425e8eaad 100644 --- a/modules/party_relationship/doc/conf.py +++ b/modules/party_relationship/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/party_relationship/doc/requirements-doc.txt b/modules/party_relationship/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/party_relationship/doc/requirements-doc.txt +++ b/modules/party_relationship/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/party_relationship/pyproject.toml b/modules/party_relationship/pyproject.toml new file mode 100644 index 0000000000..7b5755f312 --- /dev/null +++ b/modules/party_relationship/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_party_relationship' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Party relationships for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "party"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +party_relationship = 'trytond.modules.party_relationship' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-party-relationship/" +changelog = "https://docs.tryton.org/modules-party-relationship/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/party_relationship" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/party_relationship/setup.py b/modules/party_relationship/setup.py deleted file mode 100755 index 5346fd5908..0000000000 --- a/modules/party_relationship/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_party_relationship' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Party Relationship module for Tryton', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-party-relationship'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton party relationship', - package_dir={'trytond.modules.party_relationship': '.'}, - packages=( - ['trytond.modules.party_relationship'] - + ['trytond.modules.party_relationship.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.party_relationship': (info.get('xml', []) - + ['tryton.cfg', 'locale/*.po', 'view/*.xml', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - party_relationship = trytond.modules.party_relationship - """, - ) diff --git a/modules/party_relationship/tox.ini b/modules/party_relationship/tox.ini index 53e3ce4cf0..097f349130 100644 --- a/modules/party_relationship/tox.ini +++ b/modules/party_relationship/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.party_relationship --omit=*/tests/* -m xmlrunner discover -s trytond.modules.party_relationship {posargs} commands_post = coverage report coverage xml diff --git a/modules/party_siret/COPYRIGHT b/modules/party_siret/COPYRIGHT index f8fd42cdc8..2e7af62ef3 100644 --- a/modules/party_siret/COPYRIGHT +++ b/modules/party_siret/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2010-2025 Cédric Krier. -Copyright (C) 2010-2013 Bertrand Chenal. -Copyright (C) 2010-2025 B2CK SPRL. +Copyright (C) 2010-2025 Cédric Krier +Copyright (C) 2010-2013 Bertrand Chenal +Copyright (C) 2010-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/party_siret/MANIFEST.in b/modules/party_siret/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/party_siret/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/party_siret/doc/conf.py b/modules/party_siret/doc/conf.py index ae7ad80ee6..a038cb8d5d 100644 --- a/modules/party_siret/doc/conf.py +++ b/modules/party_siret/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/party_siret/doc/requirements-doc.txt b/modules/party_siret/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/party_siret/doc/requirements-doc.txt +++ b/modules/party_siret/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/party_siret/pyproject.toml b/modules/party_siret/pyproject.toml new file mode 100644 index 0000000000..5941b215f9 --- /dev/null +++ b/modules/party_siret/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_party_siret' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "SIRET and SIREN for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "party", "SIRET", "SIREN"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +party_siret = 'trytond.modules.party_siret' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-party-siret/" +changelog = "https://docs.tryton.org/modules-party-siret/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/party_siret" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/party_siret/setup.py b/modules/party_siret/setup.py deleted file mode 100755 index 3c5176caed..0000000000 --- a/modules/party_siret/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_party_siret' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to add SIRET/SIREN on parties', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/modules-party-siret', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton party siret siren', - package_dir={'trytond.modules.party_siret': '.'}, - packages=( - ['trytond.modules.party_siret'] - + ['trytond.modules.party_siret.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.party_siret': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - party_siret = trytond.modules.party_siret - """, - ) diff --git a/modules/party_siret/tox.ini b/modules/party_siret/tox.ini index 53e3ce4cf0..f464913fb1 100644 --- a/modules/party_siret/tox.ini +++ b/modules/party_siret/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.party_siret --omit=*/tests/* -m xmlrunner discover -s trytond.modules.party_siret {posargs} commands_post = coverage report coverage xml diff --git a/modules/product/COPYRIGHT b/modules/product/COPYRIGHT index 2babb3e0a8..e35e734acd 100644 --- a/modules/product/COPYRIGHT +++ b/modules/product/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product/MANIFEST.in b/modules/product/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product/doc/conf.py b/modules/product/doc/conf.py index 55ed1963ac..032d5b891c 100644 --- a/modules/product/doc/conf.py +++ b/modules/product/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product/doc/requirements-doc.txt b/modules/product/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product/doc/requirements-doc.txt +++ b/modules/product/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product/pyproject.toml b/modules/product/pyproject.toml new file mode 100644 index 0000000000..37c9f0757a --- /dev/null +++ b/modules/product/pyproject.toml @@ -0,0 +1,65 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Products for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product = 'trytond.modules.product' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product/" +changelog = "https://docs.tryton.org/modules-product/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql', + 'python-stdnum', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond[barcode]', + ] diff --git a/modules/product/setup.py b/modules/product/setup.py deleted file mode 100755 index 641cbaa8cc..0000000000 --- a/modules/product/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql', 'python-stdnum'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond[barcode]'), - ] - -setup(name=name, - version=version, - description='Tryton module with products', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-product/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product', - package_dir={'trytond.modules.product': '.'}, - packages=( - ['trytond.modules.product'] - + ['trytond.modules.product.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.product': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product = trytond.modules.product - """, - ) diff --git a/modules/product/tox.ini b/modules/product/tox.ini index 53e3ce4cf0..ac34e3f8ea 100644 --- a/modules/product/tox.ini +++ b/modules/product/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_attribute/COPYRIGHT b/modules/product_attribute/COPYRIGHT index 455be7decc..2694803af1 100644 --- a/modules/product_attribute/COPYRIGHT +++ b/modules/product_attribute/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2012-2025 Cédric Krier. -Copyright (C) 2012-2025 B2CK SPRL. +Copyright (C) 2012-2025 Cédric Krier +Copyright (C) 2012-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_attribute/MANIFEST.in b/modules/product_attribute/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_attribute/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_attribute/doc/conf.py b/modules/product_attribute/doc/conf.py index f4389fffed..97535db30a 100644 --- a/modules/product_attribute/doc/conf.py +++ b/modules/product_attribute/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_attribute/doc/requirements-doc.txt b/modules/product_attribute/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_attribute/doc/requirements-doc.txt +++ b/modules/product_attribute/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_attribute/pyproject.toml b/modules/product_attribute/pyproject.toml new file mode 100644 index 0000000000..ef7d5a8565 --- /dev/null +++ b/modules/product_attribute/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_attribute' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product attributes for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_attribute = 'trytond.modules.product_attribute' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-attribute/" +changelog = "https://docs.tryton.org/modules-product-attribute/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_attribute" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/product_attribute/setup.py b/modules/product_attribute/setup.py deleted file mode 100755 index 5cad1947a5..0000000000 --- a/modules/product_attribute/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_attribute' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('trytond_purchase'), - get_require_version('trytond_sale'), - ] - -setup(name=name, - version=version, - description='Tryton module with product attributes', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": - 'https://docs.tryton.org/latest/modules-product-attribute', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product attribute', - package_dir={'trytond.modules.product_attribute': '.'}, - packages=( - ['trytond.modules.product_attribute'] - + ['trytond.modules.product_attribute.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_attribute': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_attribute = trytond.modules.product_attribute - """, - ) diff --git a/modules/product_attribute/tox.ini b/modules/product_attribute/tox.ini index 53e3ce4cf0..8406bf1f61 100644 --- a/modules/product_attribute/tox.ini +++ b/modules/product_attribute/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_attribute --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_attribute {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_classification/COPYRIGHT b/modules/product_classification/COPYRIGHT index 027b10a997..6c34774f53 100644 --- a/modules/product_classification/COPYRIGHT +++ b/modules/product_classification/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_classification/MANIFEST.in b/modules/product_classification/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_classification/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_classification/doc/conf.py b/modules/product_classification/doc/conf.py index 74fe41a660..49bdb4ab58 100644 --- a/modules/product_classification/doc/conf.py +++ b/modules/product_classification/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_classification/doc/requirements-doc.txt b/modules/product_classification/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_classification/doc/requirements-doc.txt +++ b/modules/product_classification/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_classification/pyproject.toml b/modules/product_classification/pyproject.toml new file mode 100644 index 0000000000..f9fe8bf00c --- /dev/null +++ b/modules/product_classification/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_classification' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product classification for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_classification = 'trytond.modules.product_classification' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-classification/" +changelog = "https://docs.tryton.org/modules-product-classification/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_classification" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/product_classification/setup.py b/modules/product_classification/setup.py deleted file mode 100755 index f560c55181..0000000000 --- a/modules/product_classification/setup.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_classification' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to implement product classification', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-product-classification'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product classification', - package_dir={'trytond.modules.product_classification': '.'}, - packages=( - ['trytond.modules.product_classification'] - + ['trytond.modules.product_classification.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_classification': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_classification = trytond.modules.product_classification - """, - ) diff --git a/modules/product_classification/tox.ini b/modules/product_classification/tox.ini index 53e3ce4cf0..74137b3a04 100644 --- a/modules/product_classification/tox.ini +++ b/modules/product_classification/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_classification --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_classification {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_classification_taxonomic/COPYRIGHT b/modules/product_classification_taxonomic/COPYRIGHT index 027b10a997..6c34774f53 100644 --- a/modules/product_classification_taxonomic/COPYRIGHT +++ b/modules/product_classification_taxonomic/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_classification_taxonomic/MANIFEST.in b/modules/product_classification_taxonomic/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_classification_taxonomic/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_classification_taxonomic/doc/conf.py b/modules/product_classification_taxonomic/doc/conf.py index f9bc4d2895..c54e2b7674 100644 --- a/modules/product_classification_taxonomic/doc/conf.py +++ b/modules/product_classification_taxonomic/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_classification_taxonomic/doc/requirements-doc.txt b/modules/product_classification_taxonomic/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_classification_taxonomic/doc/requirements-doc.txt +++ b/modules/product_classification_taxonomic/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_classification_taxonomic/pyproject.toml b/modules/product_classification_taxonomic/pyproject.toml new file mode 100644 index 0000000000..c66d66ffed --- /dev/null +++ b/modules/product_classification_taxonomic/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_classification_taxonomic' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product taxonomy for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_classification_taxonomic = 'trytond.modules.product_classification_taxonomic' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-classification-taxonomic/" +changelog = "https://docs.tryton.org/modules-product-classification-taxonomic/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_classification_taxonomic" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/product_classification_taxonomic/setup.py b/modules/product_classification_taxonomic/setup.py deleted file mode 100755 index 271031c6e5..0000000000 --- a/modules/product_classification_taxonomic/setup.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_classification_taxonomic' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to implement product classification taxonomic', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product classification taxonomic', - package_dir={'trytond.modules.product_classification_taxonomic': '.'}, - packages=( - ['trytond.modules.product_classification_taxonomic'] - + ['trytond.modules.product_classification_taxonomic.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_classification_taxonomic': ( - info.get('xml', []) + ['tryton.cfg', 'view/*.xml', 'locale/*.po', - 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_classification_taxonomic = trytond.modules.product_classification_taxonomic - """, # noqa: E501 - ) diff --git a/modules/product_classification_taxonomic/tox.ini b/modules/product_classification_taxonomic/tox.ini index 53e3ce4cf0..6c80b41742 100644 --- a/modules/product_classification_taxonomic/tox.ini +++ b/modules/product_classification_taxonomic/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_classification_taxonomic --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_classification_taxonomic {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_cost_fifo/COPYRIGHT b/modules/product_cost_fifo/COPYRIGHT index a392859693..dc839cb31b 100644 --- a/modules/product_cost_fifo/COPYRIGHT +++ b/modules/product_cost_fifo/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_cost_fifo/MANIFEST.in b/modules/product_cost_fifo/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_cost_fifo/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_cost_fifo/doc/conf.py b/modules/product_cost_fifo/doc/conf.py index 1a25df07ef..a0cb2e9ba5 100644 --- a/modules/product_cost_fifo/doc/conf.py +++ b/modules/product_cost_fifo/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_cost_fifo/doc/requirements-doc.txt b/modules/product_cost_fifo/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_cost_fifo/doc/requirements-doc.txt +++ b/modules/product_cost_fifo/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_cost_fifo/pyproject.toml b/modules/product_cost_fifo/pyproject.toml new file mode 100644 index 0000000000..31a6d02dc8 --- /dev/null +++ b/modules/product_cost_fifo/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_cost_fifo' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "FIFO product cost for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product", "FIFO"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_cost_fifo = 'trytond.modules.product_cost_fifo' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-cost-fifo/" +changelog = "https://docs.tryton.org/modules-product-cost-fifo/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_cost_fifo" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/product_cost_fifo/setup.py b/modules/product_cost_fifo/setup.py deleted file mode 100755 index 464a3a2421..0000000000 --- a/modules/product_cost_fifo/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_cost_fifo' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to add FIFO cost method', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product cost fifo', - package_dir={'trytond.modules.product_cost_fifo': '.'}, - packages=( - ['trytond.modules.product_cost_fifo'] - + ['trytond.modules.product_cost_fifo.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_cost_fifo': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_cost_fifo = trytond.modules.product_cost_fifo - """, - ) diff --git a/modules/product_cost_fifo/tox.ini b/modules/product_cost_fifo/tox.ini index 53e3ce4cf0..d9c19f1cd4 100644 --- a/modules/product_cost_fifo/tox.ini +++ b/modules/product_cost_fifo/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_cost_fifo --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_cost_fifo {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_cost_history/COPYRIGHT b/modules/product_cost_history/COPYRIGHT index 3c933baa0c..e8c9eb806d 100644 --- a/modules/product_cost_history/COPYRIGHT +++ b/modules/product_cost_history/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2009-2025 Cédric Krier. -Copyright (C) 2009-2012 Bertrand Chenal. -Copyright (C) 2009-2025 B2CK SPRL. +Copyright (C) 2009-2025 Cédric Krier +Copyright (C) 2009-2012 Bertrand Chenal +Copyright (C) 2009-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_cost_history/MANIFEST.in b/modules/product_cost_history/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_cost_history/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_cost_history/doc/conf.py b/modules/product_cost_history/doc/conf.py index 183f3f1e51..390e298dbd 100644 --- a/modules/product_cost_history/doc/conf.py +++ b/modules/product_cost_history/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_cost_history/doc/requirements-doc.txt b/modules/product_cost_history/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_cost_history/doc/requirements-doc.txt +++ b/modules/product_cost_history/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_cost_history/pyproject.toml b/modules/product_cost_history/pyproject.toml new file mode 100644 index 0000000000..3618c72ac9 --- /dev/null +++ b/modules/product_cost_history/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_cost_history' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product cost history for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_cost_history = 'trytond.modules.product_cost_history' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-cost-history/" +changelog = "https://docs.tryton.org/modules-product-cost-history/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_cost_history" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/product_cost_history/setup.py b/modules/product_cost_history/setup.py deleted file mode 100755 index 2b6e85479e..0000000000 --- a/modules/product_cost_history/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_cost_history' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to historize product cost', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product cost history', - package_dir={'trytond.modules.product_cost_history': '.'}, - packages=( - ['trytond.modules.product_cost_history'] - + ['trytond.modules.product_cost_history.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_cost_history': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_cost_history = trytond.modules.product_cost_history - """, - ) diff --git a/modules/product_cost_history/tox.ini b/modules/product_cost_history/tox.ini index 53e3ce4cf0..ae15489ad7 100644 --- a/modules/product_cost_history/tox.ini +++ b/modules/product_cost_history/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_cost_history --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_cost_history {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_cost_warehouse/COPYRIGHT b/modules/product_cost_warehouse/COPYRIGHT index f85dc624b4..01cea9b9c1 100644 --- a/modules/product_cost_warehouse/COPYRIGHT +++ b/modules/product_cost_warehouse/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2020-2025 B2CK -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL +Copyright (C) 2020-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_cost_warehouse/MANIFEST.in b/modules/product_cost_warehouse/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_cost_warehouse/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_cost_warehouse/doc/conf.py b/modules/product_cost_warehouse/doc/conf.py index 408cba5071..e29d75f7a0 100644 --- a/modules/product_cost_warehouse/doc/conf.py +++ b/modules/product_cost_warehouse/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_cost_warehouse/doc/requirements-doc.txt b/modules/product_cost_warehouse/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_cost_warehouse/doc/requirements-doc.txt +++ b/modules/product_cost_warehouse/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_cost_warehouse/pyproject.toml b/modules/product_cost_warehouse/pyproject.toml new file mode 100644 index 0000000000..0b83457c65 --- /dev/null +++ b/modules/product_cost_warehouse/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_cost_warehouse' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product cost per warehouse for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = [] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_cost_warehouse = 'trytond.modules.product_cost_warehouse' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-cost-warehouse/" +changelog = "https://docs.tryton.org/modules-product-cost-warehouse/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_cost_warehouse" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/product_cost_warehouse/setup.py b/modules/product_cost_warehouse/setup.py deleted file mode 100755 index 293e6a22c7..0000000000 --- a/modules/product_cost_warehouse/setup.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_cost_warehouse' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_invoice_stock'), - get_require_version('trytond_product_cost_fifo'), - get_require_version('trytond_product_cost_history'), - get_require_version('trytond_account_stock_continental'), - ] - -setup(name=name, - version=version, - description='Tryton module to compute product cost per warehouse', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-product-cost-warehouse'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product cost warehouse', - package_dir={'trytond.modules.product_cost_warehouse': '.'}, - packages=( - ['trytond.modules.product_cost_warehouse'] - + ['trytond.modules.product_cost_warehouse.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_cost_warehouse': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_cost_warehouse = trytond.modules.product_cost_warehouse - """, # noqa: E501 - ) diff --git a/modules/product_cost_warehouse/tox.ini b/modules/product_cost_warehouse/tox.ini index 53e3ce4cf0..3e1aed82c6 100644 --- a/modules/product_cost_warehouse/tox.ini +++ b/modules/product_cost_warehouse/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_cost_warehouse --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_cost_warehouse {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_image/COPYRIGHT b/modules/product_image/COPYRIGHT index bb6a8a0544..e4a7445742 100644 --- a/modules/product_image/COPYRIGHT +++ b/modules/product_image/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_image/MANIFEST.in b/modules/product_image/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_image/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_image/doc/conf.py b/modules/product_image/doc/conf.py index 4ef2708c80..ab2efb9abc 100644 --- a/modules/product_image/doc/conf.py +++ b/modules/product_image/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_image/doc/requirements-doc.txt b/modules/product_image/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_image/doc/requirements-doc.txt +++ b/modules/product_image/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_image/pyproject.toml b/modules/product_image/pyproject.toml new file mode 100644 index 0000000000..2c23a51650 --- /dev/null +++ b/modules/product_image/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_image' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product images for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product", "image", "thumbnail"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_image = 'trytond.modules.product_image' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-image/" +changelog = "https://docs.tryton.org/modules-product-image/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_image" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['pillow'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/product_image/setup.py b/modules/product_image/setup.py deleted file mode 100755 index ded8707049..0000000000 --- a/modules/product_image/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_image' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['pillow'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module that adds images to products', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-product-image'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product image thumbnail', - package_dir={'trytond.modules.product_image': '.'}, - packages=( - ['trytond.modules.product_image'] - + ['trytond.modules.product_image.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_image': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_image = trytond.modules.product_image - """, # noqa: E501 - ) diff --git a/modules/product_image/tox.ini b/modules/product_image/tox.ini index 53e3ce4cf0..c45f0689d5 100644 --- a/modules/product_image/tox.ini +++ b/modules/product_image/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_image --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_image {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_image_attribute/COPYRIGHT b/modules/product_image_attribute/COPYRIGHT index 523289548e..202b682dd7 100644 --- a/modules/product_image_attribute/COPYRIGHT +++ b/modules/product_image_attribute/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_image_attribute/MANIFEST.in b/modules/product_image_attribute/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_image_attribute/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_image_attribute/doc/conf.py b/modules/product_image_attribute/doc/conf.py index b46c533607..46577ab6fc 100644 --- a/modules/product_image_attribute/doc/conf.py +++ b/modules/product_image_attribute/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_image_attribute/doc/requirements-doc.txt b/modules/product_image_attribute/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_image_attribute/doc/requirements-doc.txt +++ b/modules/product_image_attribute/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_image_attribute/pyproject.toml b/modules/product_image_attribute/pyproject.toml new file mode 100644 index 0000000000..ab97f0508f --- /dev/null +++ b/modules/product_image_attribute/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_image_attribute' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product images per attributes for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product", "image"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_image_attribute = 'trytond.modules.product_image_attribute' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-image-attribute/" +changelog = "https://docs.tryton.org/modules-product-image-attribute/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_image_attribute" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/product_image_attribute/setup.py b/modules/product_image_attribute/setup.py deleted file mode 100755 index f0197512f3..0000000000 --- a/modules/product_image_attribute/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_image_attribute' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to select variant images based on attributes', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-product-image-attribute'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product image attribute', - package_dir={'trytond.modules.product_image_attribute': '.'}, - packages=( - ['trytond.modules.product_image_attribute'] - + ['trytond.modules.product_image_attribute.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_image_attribute': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_image_attribute = trytond.modules.product_image_attribute - """, # noqa: E501 - ) diff --git a/modules/product_image_attribute/tox.ini b/modules/product_image_attribute/tox.ini index 53e3ce4cf0..5d904e2832 100644 --- a/modules/product_image_attribute/tox.ini +++ b/modules/product_image_attribute/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_image_attribute --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_image_attribute {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_kit/COPYRIGHT b/modules/product_kit/COPYRIGHT index 1272b06554..d173287640 100644 --- a/modules/product_kit/COPYRIGHT +++ b/modules/product_kit/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2020-2025 B2CK -Copyright (C) 2020-2025 Cédric Krier -Copyright (C) 2020-2023 Sergi Almacellas Abellana +Copyright (C) 2020-2025 B2CK SRL +Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2023 Sergi Almacellas Abellana This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_kit/MANIFEST.in b/modules/product_kit/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_kit/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_kit/doc/conf.py b/modules/product_kit/doc/conf.py index 93d98bd9dd..637567df19 100644 --- a/modules/product_kit/doc/conf.py +++ b/modules/product_kit/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_kit/doc/requirements-doc.txt b/modules/product_kit/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_kit/doc/requirements-doc.txt +++ b/modules/product_kit/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_kit/pyproject.toml b/modules/product_kit/pyproject.toml new file mode 100644 index 0000000000..2dbe086cb2 --- /dev/null +++ b/modules/product_kit/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_kit' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product kits for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_kit = 'trytond.modules.product_kit' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-kit/" +changelog = "https://docs.tryton.org/modules-product-kit/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_kit" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/product_kit/setup.py b/modules/product_kit/setup.py deleted file mode 100755 index fbeb153bf4..0000000000 --- a/modules/product_kit/setup.py +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_kit' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_invoice'), - get_require_version('trytond_account_invoice_stock'), - get_require_version('trytond_company'), - get_require_version('trytond_purchase'), - get_require_version('trytond_purchase_amendment'), - get_require_version('trytond_sale'), - get_require_version('trytond_sale_amendment'), - get_require_version('trytond_stock'), - ] - -setup(name=name, - version=version, - description='Tryton module to manage product kits and components', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ('https://docs.tryton.org/' - 'modules-product-kit'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='', - package_dir={'trytond.modules.product_kit': '.'}, - packages=( - ['trytond.modules.product_kit'] - + ['trytond.modules.product_kit.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_kit': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_kit = trytond.modules.product_kit - """, # noqa: E501 - ) diff --git a/modules/product_kit/tox.ini b/modules/product_kit/tox.ini index 53e3ce4cf0..39637a9769 100644 --- a/modules/product_kit/tox.ini +++ b/modules/product_kit/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_kit --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_kit {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_measurements/COPYRIGHT b/modules/product_measurements/COPYRIGHT index 3bc89e0de8..4126e0f40b 100644 --- a/modules/product_measurements/COPYRIGHT +++ b/modules/product_measurements/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2012 Bertrand Chenal. -Copyright (C) 2011-2025 Nicolas Évrard. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2012 Bertrand Chenal +Copyright (C) 2011-2025 Nicolas Évrard +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_measurements/MANIFEST.in b/modules/product_measurements/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_measurements/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_measurements/doc/conf.py b/modules/product_measurements/doc/conf.py index 8a0e135a1b..0c95cf231c 100644 --- a/modules/product_measurements/doc/conf.py +++ b/modules/product_measurements/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_measurements/doc/requirements-doc.txt b/modules/product_measurements/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_measurements/doc/requirements-doc.txt +++ b/modules/product_measurements/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_measurements/pyproject.toml b/modules/product_measurements/pyproject.toml new file mode 100644 index 0000000000..fb64b3f862 --- /dev/null +++ b/modules/product_measurements/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_measurements' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product measurements for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_measurements = 'trytond.modules.product_measurements' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-measurements/" +changelog = "https://docs.tryton.org/modules-product-measurements/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_measurements" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/product_measurements/setup.py b/modules/product_measurements/setup.py deleted file mode 100755 index 0f7c47cc9f..0000000000 --- a/modules/product_measurements/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_measurements' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('trytond_product_price_list'), - ] - -setup(name=name, - version=version, - description='Tryton module to add measurements to product', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product measurement', - package_dir={'trytond.modules.product_measurements': '.'}, - packages=( - ['trytond.modules.product_measurements'] - + ['trytond.modules.product_measurements.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_measurements': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_measurements = trytond.modules.product_measurements - """, - ) diff --git a/modules/product_measurements/tox.ini b/modules/product_measurements/tox.ini index 53e3ce4cf0..eaaaab8a6f 100644 --- a/modules/product_measurements/tox.ini +++ b/modules/product_measurements/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_measurements --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_measurements {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_price_list/COPYRIGHT b/modules/product_price_list/COPYRIGHT index f884df0db0..c798a5d300 100644 --- a/modules/product_price_list/COPYRIGHT +++ b/modules/product_price_list/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2009-2025 Cédric Krier. -Copyright (C) 2009-2013 Bertrand Chenal. -Copyright (C) 2009-2025 B2CK SPRL. +Copyright (C) 2009-2025 Cédric Krier +Copyright (C) 2009-2013 Bertrand Chenal +Copyright (C) 2009-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_price_list/MANIFEST.in b/modules/product_price_list/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_price_list/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_price_list/doc/conf.py b/modules/product_price_list/doc/conf.py index dabe57f680..10130059e1 100644 --- a/modules/product_price_list/doc/conf.py +++ b/modules/product_price_list/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_price_list/doc/requirements-doc.txt b/modules/product_price_list/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_price_list/doc/requirements-doc.txt +++ b/modules/product_price_list/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_price_list/pyproject.toml b/modules/product_price_list/pyproject.toml new file mode 100644 index 0000000000..ba760b377b --- /dev/null +++ b/modules/product_price_list/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_price_list' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Produc price list for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_price_list = 'trytond.modules.product_price_list' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-price-list/" +changelog = "https://docs.tryton.org/modules-product-price-list/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_price_list" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql >= 0.4', + 'simpleeval', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/product_price_list/setup.py b/modules/product_price_list/setup.py deleted file mode 100755 index 7a46d28807..0000000000 --- a/modules/product_price_list/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_price_list' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['simpleeval', 'python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module with price list', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product price list', - package_dir={'trytond.modules.product_price_list': '.'}, - packages=( - ['trytond.modules.product_price_list'] - + ['trytond.modules.product_price_list.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_price_list': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_price_list = trytond.modules.product_price_list - """, - ) diff --git a/modules/product_price_list/tox.ini b/modules/product_price_list/tox.ini index 53e3ce4cf0..a360a85e65 100644 --- a/modules/product_price_list/tox.ini +++ b/modules/product_price_list/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_price_list --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_price_list {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_price_list_cache/COPYRIGHT b/modules/product_price_list_cache/COPYRIGHT index 25c39c6a16..3bd10b2f57 100644 --- a/modules/product_price_list_cache/COPYRIGHT +++ b/modules/product_price_list_cache/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2023-2025 Cédric Krier -Copyright (C) 2023-2025 B2CK +Copyright (C) 2023-2025 Cédric Krier +Copyright (C) 2023-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_price_list_cache/MANIFEST.in b/modules/product_price_list_cache/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_price_list_cache/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_price_list_cache/doc/conf.py b/modules/product_price_list_cache/doc/conf.py index 751208e75d..570a6c3067 100644 --- a/modules/product_price_list_cache/doc/conf.py +++ b/modules/product_price_list_cache/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_price_list_cache/doc/requirements-doc.txt b/modules/product_price_list_cache/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_price_list_cache/doc/requirements-doc.txt +++ b/modules/product_price_list_cache/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_price_list_cache/pyproject.toml b/modules/product_price_list_cache/pyproject.toml new file mode 100644 index 0000000000..fa1a0d8f7f --- /dev/null +++ b/modules/product_price_list_cache/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_price_list_cache' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Cache for product price list in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_price_list_cache = 'trytond.modules.product_price_list_cache' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-price-list-cache/" +changelog = "https://docs.tryton.org/modules-product-price-list-cache/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_price_list_cache" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/product_price_list_cache/setup.py b/modules/product_price_list_cache/setup.py deleted file mode 100755 index cb1a697aec..0000000000 --- a/modules/product_price_list_cache/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_price_list_cache' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description="Tryton module to cache price lists", - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-product-price-list-cache'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton product price list cache', - package_dir={'trytond.modules.product_price_list_cache': '.'}, - packages=( - ['trytond.modules.product_price_list_cache'] - + ['trytond.modules.product_price_list_cache.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_price_list_cache': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_price_list_cache = trytond.modules.product_price_list_cache - """, # noqa: E501 - ) diff --git a/modules/product_price_list_cache/tox.ini b/modules/product_price_list_cache/tox.ini index 53e3ce4cf0..d3a2b66579 100644 --- a/modules/product_price_list_cache/tox.ini +++ b/modules/product_price_list_cache/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_price_list_cache --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_price_list_cache {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_price_list_dates/COPYRIGHT b/modules/product_price_list_dates/COPYRIGHT index 9512eceaed..6f3a8ebb90 100644 --- a/modules/product_price_list_dates/COPYRIGHT +++ b/modules/product_price_list_dates/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2017-2025 Cédric Krier -Copyright (C) 2017-2025 B2CK +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_price_list_dates/MANIFEST.in b/modules/product_price_list_dates/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_price_list_dates/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_price_list_dates/doc/conf.py b/modules/product_price_list_dates/doc/conf.py index a5332c3278..061b8b0bdb 100644 --- a/modules/product_price_list_dates/doc/conf.py +++ b/modules/product_price_list_dates/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_price_list_dates/doc/requirements-doc.txt b/modules/product_price_list_dates/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_price_list_dates/doc/requirements-doc.txt +++ b/modules/product_price_list_dates/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_price_list_dates/pyproject.toml b/modules/product_price_list_dates/pyproject.toml new file mode 100644 index 0000000000..6641cd0003 --- /dev/null +++ b/modules/product_price_list_dates/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_price_list_dates' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product price list per dates for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_price_list_dates = 'trytond.modules.product_price_list_dates' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-price-list-dates/" +changelog = "https://docs.tryton.org/modules-product-price-list-dates/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_price_list_dates" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/product_price_list_dates/setup.py b/modules/product_price_list_dates/setup.py deleted file mode 100755 index 536db32e34..0000000000 --- a/modules/product_price_list_dates/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_price_list_dates' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('trytond_product_price_list_cache'), - get_require_version('trytond_purchase_price_list'), - get_require_version('trytond_sale_price_list'), - ] - -setup(name=name, - version=version, - description='Tryton module to add dates on price list', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton price list', - package_dir={'trytond.modules.product_price_list_dates': '.'}, - packages=( - ['trytond.modules.product_price_list_dates'] - + ['trytond.modules.product_price_list_dates.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_price_list_dates': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_price_list_dates = trytond.modules.product_price_list_dates - """, - ) diff --git a/modules/product_price_list_dates/tox.ini b/modules/product_price_list_dates/tox.ini index 53e3ce4cf0..258cc74a8a 100644 --- a/modules/product_price_list_dates/tox.ini +++ b/modules/product_price_list_dates/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_price_list_dates --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_price_list_dates {posargs} commands_post = coverage report coverage xml diff --git a/modules/product_price_list_parent/COPYRIGHT b/modules/product_price_list_parent/COPYRIGHT index 9bb4210eea..a6f13c69ad 100644 --- a/modules/product_price_list_parent/COPYRIGHT +++ b/modules/product_price_list_parent/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2018-2025 B2CK -Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL +Copyright (C) 2018-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/product_price_list_parent/MANIFEST.in b/modules/product_price_list_parent/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/product_price_list_parent/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/product_price_list_parent/doc/conf.py b/modules/product_price_list_parent/doc/conf.py index b307a56c6a..9725e9febf 100644 --- a/modules/product_price_list_parent/doc/conf.py +++ b/modules/product_price_list_parent/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/product_price_list_parent/doc/requirements-doc.txt b/modules/product_price_list_parent/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/product_price_list_parent/doc/requirements-doc.txt +++ b/modules/product_price_list_parent/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/product_price_list_parent/pyproject.toml b/modules/product_price_list_parent/pyproject.toml new file mode 100644 index 0000000000..d6bdd4ad55 --- /dev/null +++ b/modules/product_price_list_parent/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_product_price_list_parent' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product price list from another price list in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "product"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +product_price_list_parent = 'trytond.modules.product_price_list_parent' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-product-price-list-parent/" +changelog = "https://docs.tryton.org/modules-product-price-list-parent/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/product_price_list_parent" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/product_price_list_parent/setup.py b/modules/product_price_list_parent/setup.py deleted file mode 100755 index 7daa77ca7d..0000000000 --- a/modules/product_price_list_parent/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_product_price_list_parent' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to use price from another price list', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton price list', - package_dir={'trytond.modules.product_price_list_parent': '.'}, - packages=( - ['trytond.modules.product_price_list_parent'] - + ['trytond.modules.product_price_list_parent.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.product_price_list_parent': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - product_price_list_parent = trytond.modules.product_price_list_parent - """, - ) diff --git a/modules/product_price_list_parent/tox.ini b/modules/product_price_list_parent/tox.ini index 53e3ce4cf0..c6daf303fa 100644 --- a/modules/product_price_list_parent/tox.ini +++ b/modules/product_price_list_parent/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.product_price_list_parent --omit=*/tests/* -m xmlrunner discover -s trytond.modules.product_price_list_parent {posargs} commands_post = coverage report coverage xml diff --git a/modules/production/COPYRIGHT b/modules/production/COPYRIGHT index 455be7decc..2694803af1 100644 --- a/modules/production/COPYRIGHT +++ b/modules/production/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2012-2025 Cédric Krier. -Copyright (C) 2012-2025 B2CK SPRL. +Copyright (C) 2012-2025 Cédric Krier +Copyright (C) 2012-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/production/MANIFEST.in b/modules/production/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/production/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/production/doc/conf.py b/modules/production/doc/conf.py index f2307c94f8..c346e7994d 100644 --- a/modules/production/doc/conf.py +++ b/modules/production/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/production/doc/requirements-doc.txt b/modules/production/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/production/doc/requirements-doc.txt +++ b/modules/production/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/production/pyproject.toml b/modules/production/pyproject.toml new file mode 100644 index 0000000000..193d5c0ee7 --- /dev/null +++ b/modules/production/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_production' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Productions for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "production"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +production = 'trytond.modules.production' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-production/" +changelog = "https://docs.tryton.org/modules-production/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/production" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/production/setup.py b/modules/production/setup.py deleted file mode 100755 index d005035baa..0000000000 --- a/modules/production/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_production' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_stock_lot'), - ] - -setup(name=name, - version=version, - description='Tryton module for production', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-production/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton production', - package_dir={'trytond.modules.production': '.'}, - packages=( - ['trytond.modules.production'] - + ['trytond.modules.production.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.production': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst', - 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - production = trytond.modules.production - """, - ) diff --git a/modules/production/tox.ini b/modules/production/tox.ini index 53e3ce4cf0..4c8bb1539e 100644 --- a/modules/production/tox.ini +++ b/modules/production/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.production --omit=*/tests/* -m xmlrunner discover -s trytond.modules.production {posargs} commands_post = coverage report coverage xml diff --git a/modules/production_outsourcing/COPYRIGHT b/modules/production_outsourcing/COPYRIGHT index 3655bc4251..7fe447c110 100644 --- a/modules/production_outsourcing/COPYRIGHT +++ b/modules/production_outsourcing/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2018-2025 Cédric Krier -Copyright (C) 2018-2025 B2CK +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/production_outsourcing/MANIFEST.in b/modules/production_outsourcing/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/production_outsourcing/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/production_outsourcing/doc/conf.py b/modules/production_outsourcing/doc/conf.py index 835404d45e..8a18871446 100644 --- a/modules/production_outsourcing/doc/conf.py +++ b/modules/production_outsourcing/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/production_outsourcing/doc/requirements-doc.txt b/modules/production_outsourcing/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/production_outsourcing/doc/requirements-doc.txt +++ b/modules/production_outsourcing/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/production_outsourcing/pyproject.toml b/modules/production_outsourcing/pyproject.toml new file mode 100644 index 0000000000..16e0a42673 --- /dev/null +++ b/modules/production_outsourcing/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_production_outsourcing' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Production outsourcing for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "production"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +production_outsourcing = 'trytond.modules.production_outsourcing' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-production-outsourcing/" +changelog = "https://docs.tryton.org/modules-production-outsourcing/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/production_outsourcing" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/production_outsourcing/setup.py b/modules/production_outsourcing/setup.py deleted file mode 100755 index 7799b2e078..0000000000 --- a/modules/production_outsourcing/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_production_outsourcing' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to outsource production', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton production outsourcing', - package_dir={'trytond.modules.production_outsourcing': '.'}, - packages=( - ['trytond.modules.production_outsourcing'] - + ['trytond.modules.production_outsourcing.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.production_outsourcing': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - production_outsourcing = trytond.modules.production_outsourcing - """, - ) diff --git a/modules/production_outsourcing/tox.ini b/modules/production_outsourcing/tox.ini index 53e3ce4cf0..786afb1935 100644 --- a/modules/production_outsourcing/tox.ini +++ b/modules/production_outsourcing/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.production_outsourcing --omit=*/tests/* -m xmlrunner discover -s trytond.modules.production_outsourcing {posargs} commands_post = coverage report coverage xml diff --git a/modules/production_routing/COPYRIGHT b/modules/production_routing/COPYRIGHT index 4dc62687ab..6ad28a3351 100644 --- a/modules/production_routing/COPYRIGHT +++ b/modules/production_routing/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. -Copyright (C) 2013-2015 NaN·tic. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL +Copyright (C) 2013-2015 NaN-tic This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/production_routing/MANIFEST.in b/modules/production_routing/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/production_routing/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/production_routing/doc/conf.py b/modules/production_routing/doc/conf.py index f1b99979f5..414e507df9 100644 --- a/modules/production_routing/doc/conf.py +++ b/modules/production_routing/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/production_routing/doc/requirements-doc.txt b/modules/production_routing/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/production_routing/doc/requirements-doc.txt +++ b/modules/production_routing/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/production_routing/pyproject.toml b/modules/production_routing/pyproject.toml new file mode 100644 index 0000000000..a8c7d58c67 --- /dev/null +++ b/modules/production_routing/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_production_routing' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Production routings for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "production"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +production_routing = 'trytond.modules.production_routing' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-production-routing/" +changelog = "https://docs.tryton.org/modules-production-routing/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/production_routing" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/production_routing/setup.py b/modules/production_routing/setup.py deleted file mode 100755 index fc53cace60..0000000000 --- a/modules/production_routing/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_production_routing' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_stock_supply_production'), - ] - -setup(name=name, - version=version, - description='Tryton module for production routing', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton production routing', - package_dir={'trytond.modules.production_routing': '.'}, - packages=( - ['trytond.modules.production_routing'] - + ['trytond.modules.production_routing.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.production_routing': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - production_routing = trytond.modules.production_routing - """, - ) diff --git a/modules/production_routing/tox.ini b/modules/production_routing/tox.ini index 53e3ce4cf0..fb696d4020 100644 --- a/modules/production_routing/tox.ini +++ b/modules/production_routing/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.production_routing --omit=*/tests/* -m xmlrunner discover -s trytond.modules.production_routing {posargs} commands_post = coverage report coverage xml diff --git a/modules/production_split/COPYRIGHT b/modules/production_split/COPYRIGHT index 6f63694a60..3500988d5b 100644 --- a/modules/production_split/COPYRIGHT +++ b/modules/production_split/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2016-2025 Cédric Krier -Copyright (C) 2016-2025 B2CK -Copyright (C) 2014 NaN·tic +Copyright (C) 2016-2025 Cédric Krier +Copyright (C) 2016-2025 B2CK SRL +Copyright (C) 2014 NaN-tic This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/production_split/MANIFEST.in b/modules/production_split/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/production_split/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/production_split/doc/conf.py b/modules/production_split/doc/conf.py index 04c62d8184..2c1d2e39b6 100644 --- a/modules/production_split/doc/conf.py +++ b/modules/production_split/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/production_split/doc/requirements-doc.txt b/modules/production_split/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/production_split/doc/requirements-doc.txt +++ b/modules/production_split/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/production_split/pyproject.toml b/modules/production_split/pyproject.toml new file mode 100644 index 0000000000..8123d0c616 --- /dev/null +++ b/modules/production_split/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_production_split' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Production splitting for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "production"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +production_split = 'trytond.modules.production_split' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-production-split/" +changelog = "https://docs.tryton.org/modules-production-split/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/production_split" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/production_split/setup.py b/modules/production_split/setup.py deleted file mode 100755 index a96d1aca17..0000000000 --- a/modules/production_split/setup.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_production_split' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - ] - -setup(name=name, - version=version, - description='Tryton module to split production', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton production split', - package_dir={'trytond.modules.production_split': '.'}, - packages=( - ['trytond.modules.production_split'] - + ['trytond.modules.production_split.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.production_split': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - production_split = trytond.modules.production_split - """, - ) diff --git a/modules/production_split/tox.ini b/modules/production_split/tox.ini index 53e3ce4cf0..c62a36dba8 100644 --- a/modules/production_split/tox.ini +++ b/modules/production_split/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.production_split --omit=*/tests/* -m xmlrunner discover -s trytond.modules.production_split {posargs} commands_post = coverage report coverage xml diff --git a/modules/production_work/COPYRIGHT b/modules/production_work/COPYRIGHT index 4dc62687ab..6ad28a3351 100644 --- a/modules/production_work/COPYRIGHT +++ b/modules/production_work/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. -Copyright (C) 2013-2015 NaN·tic. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL +Copyright (C) 2013-2015 NaN-tic This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/production_work/MANIFEST.in b/modules/production_work/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/production_work/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/production_work/doc/conf.py b/modules/production_work/doc/conf.py index cbd2c2214f..8be70b7b76 100644 --- a/modules/production_work/doc/conf.py +++ b/modules/production_work/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/production_work/doc/requirements-doc.txt b/modules/production_work/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/production_work/doc/requirements-doc.txt +++ b/modules/production_work/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/production_work/pyproject.toml b/modules/production_work/pyproject.toml new file mode 100644 index 0000000000..816e98dc69 --- /dev/null +++ b/modules/production_work/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_production_work' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Production works for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "production"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +production_work = 'trytond.modules.production_work' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-production-work/" +changelog = "https://docs.tryton.org/modules-production-work/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/production_work" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/production_work/setup.py b/modules/production_work/setup.py deleted file mode 100755 index b8c21b95b5..0000000000 --- a/modules/production_work/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_production_work' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for production work', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton production work', - package_dir={'trytond.modules.production_work': '.'}, - packages=( - ['trytond.modules.production_work'] - + ['trytond.modules.production_work.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.production_work': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - production_work = trytond.modules.production_work - """, - ) diff --git a/modules/production_work/tox.ini b/modules/production_work/tox.ini index 53e3ce4cf0..84f1f5e155 100644 --- a/modules/production_work/tox.ini +++ b/modules/production_work/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.production_work --omit=*/tests/* -m xmlrunner discover -s trytond.modules.production_work {posargs} commands_post = coverage report coverage xml diff --git a/modules/production_work_timesheet/COPYRIGHT b/modules/production_work_timesheet/COPYRIGHT index 5e97b93a9c..20cd6e00b2 100644 --- a/modules/production_work_timesheet/COPYRIGHT +++ b/modules/production_work_timesheet/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2016-2025 Cédric Krier -Copyright (C) 2016-2025 B2CK +Copyright (C) 2016-2025 Cédric Krier +Copyright (C) 2016-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/production_work_timesheet/MANIFEST.in b/modules/production_work_timesheet/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/production_work_timesheet/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/production_work_timesheet/doc/conf.py b/modules/production_work_timesheet/doc/conf.py index 2b66d24de6..b7b16f95cb 100644 --- a/modules/production_work_timesheet/doc/conf.py +++ b/modules/production_work_timesheet/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/production_work_timesheet/doc/requirements-doc.txt b/modules/production_work_timesheet/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/production_work_timesheet/doc/requirements-doc.txt +++ b/modules/production_work_timesheet/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/production_work_timesheet/pyproject.toml b/modules/production_work_timesheet/pyproject.toml new file mode 100644 index 0000000000..755354cc2e --- /dev/null +++ b/modules/production_work_timesheet/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_production_work_timesheet' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Production work timesheets for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "production", "timesheet"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +production_work_timesheet = 'trytond.modules.production_work_timesheet' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-production-work-timesheet/" +changelog = "https://docs.tryton.org/modules-production-work-timesheet/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/production_work_timesheet" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/production_work_timesheet/setup.py b/modules/production_work_timesheet/setup.py deleted file mode 100755 index eb82cfa9a3..0000000000 --- a/modules/production_work_timesheet/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_production_work_timesheet' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module for timesheet on production work', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton production work timesheet', - package_dir={'trytond.modules.production_work_timesheet': '.'}, - packages=( - ['trytond.modules.production_work_timesheet'] - + ['trytond.modules.production_work_timesheet.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.production_work_timesheet': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - production_work_timesheet = trytond.modules.production_work_timesheet - """, - ) diff --git a/modules/production_work_timesheet/tox.ini b/modules/production_work_timesheet/tox.ini index 53e3ce4cf0..44fd24b3d8 100644 --- a/modules/production_work_timesheet/tox.ini +++ b/modules/production_work_timesheet/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.production_work_timesheet --omit=*/tests/* -m xmlrunner discover -s trytond.modules.production_work_timesheet {posargs} commands_post = coverage report coverage xml diff --git a/modules/project/COPYRIGHT b/modules/project/COPYRIGHT index c8e0061f00..6720aaac13 100644 --- a/modules/project/COPYRIGHT +++ b/modules/project/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2009-2013 Bertrand Chenal. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2009-2013 Bertrand Chenal This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/project/MANIFEST.in b/modules/project/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/project/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/project/doc/conf.py b/modules/project/doc/conf.py index e6d22eb038..b5061198ba 100644 --- a/modules/project/doc/conf.py +++ b/modules/project/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/project/doc/requirements-doc.txt b/modules/project/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/project/doc/requirements-doc.txt +++ b/modules/project/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/project/pyproject.toml b/modules/project/pyproject.toml new file mode 100644 index 0000000000..577131a9b2 --- /dev/null +++ b/modules/project/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_project' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Projects for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "project"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +project = 'trytond.modules.project' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-project/" +changelog = "https://docs.tryton.org/modules-project/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/project" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/project/setup.py b/modules/project/setup.py deleted file mode 100755 index e6a45a384f..0000000000 --- a/modules/project/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_project' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module with projects', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-project/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton project', - package_dir={'trytond.modules.project': '.'}, - packages=( - ['trytond.modules.project'] - + ['trytond.modules.project.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.project': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg', - '*.fodt', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - project = trytond.modules.project - """, - ) diff --git a/modules/project/tox.ini b/modules/project/tox.ini index 53e3ce4cf0..f578ed2279 100644 --- a/modules/project/tox.ini +++ b/modules/project/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.project --omit=*/tests/* -m xmlrunner discover -s trytond.modules.project {posargs} commands_post = coverage report coverage xml diff --git a/modules/project_invoice/COPYRIGHT b/modules/project_invoice/COPYRIGHT index c5f9863cf1..a2d4e65b8c 100644 --- a/modules/project_invoice/COPYRIGHT +++ b/modules/project_invoice/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2013-2025 Cédric Krier. -Copyright (C) 2013-2025 B2CK SPRL. +Copyright (C) 2013-2025 Cédric Krier +Copyright (C) 2013-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/project_invoice/MANIFEST.in b/modules/project_invoice/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/project_invoice/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/project_invoice/doc/conf.py b/modules/project_invoice/doc/conf.py index c577059c3a..8d0ebd9c38 100644 --- a/modules/project_invoice/doc/conf.py +++ b/modules/project_invoice/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/project_invoice/doc/requirements-doc.txt b/modules/project_invoice/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/project_invoice/doc/requirements-doc.txt +++ b/modules/project_invoice/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/project_invoice/pyproject.toml b/modules/project_invoice/pyproject.toml new file mode 100644 index 0000000000..ac554b5632 --- /dev/null +++ b/modules/project_invoice/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_project_invoice' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Projects invoicing for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "project", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +project_invoice = 'trytond.modules.project_invoice' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-project-invoice/" +changelog = "https://docs.tryton.org/modules-project-invoice/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/project_invoice" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/project_invoice/setup.py b/modules/project_invoice/setup.py deleted file mode 100755 index b59ac38043..0000000000 --- a/modules/project_invoice/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_project_invoice' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to invoice projects', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton project invoice', - package_dir={'trytond.modules.project_invoice': '.'}, - packages=( - ['trytond.modules.project_invoice'] - + ['trytond.modules.project_invoice.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.project_invoice': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - project_invoice = trytond.modules.project_invoice - """, - ) diff --git a/modules/project_invoice/tox.ini b/modules/project_invoice/tox.ini index 53e3ce4cf0..aae382f9bf 100644 --- a/modules/project_invoice/tox.ini +++ b/modules/project_invoice/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.project_invoice --omit=*/tests/* -m xmlrunner discover -s trytond.modules.project_invoice {posargs} commands_post = coverage report coverage xml diff --git a/modules/project_plan/COPYRIGHT b/modules/project_plan/COPYRIGHT index c53a16430c..0ce08c00f9 100644 --- a/modules/project_plan/COPYRIGHT +++ b/modules/project_plan/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2009-2013 Bertrand Chenal. -Copyright (C) 2009-2025 Cédric Krier. -Copyright (C) 2009-2025 B2CK SPRL. +Copyright (C) 2009-2013 Bertrand Chenal +Copyright (C) 2009-2025 Cédric Krier +Copyright (C) 2009-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/project_plan/MANIFEST.in b/modules/project_plan/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/project_plan/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/project_plan/doc/conf.py b/modules/project_plan/doc/conf.py index eff89329bd..ff04084603 100644 --- a/modules/project_plan/doc/conf.py +++ b/modules/project_plan/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/project_plan/doc/requirements-doc.txt b/modules/project_plan/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/project_plan/doc/requirements-doc.txt +++ b/modules/project_plan/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/project_plan/pyproject.toml b/modules/project_plan/pyproject.toml new file mode 100644 index 0000000000..1b205824fe --- /dev/null +++ b/modules/project_plan/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_project_plan' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Project planning for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "project"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +project_plan = 'trytond.modules.project_plan' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-project-plan/" +changelog = "https://docs.tryton.org/modules-project-plan/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/project_plan" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/project_plan/setup.py b/modules/project_plan/setup.py deleted file mode 100755 index 5f653db495..0000000000 --- a/modules/project_plan/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_project_plan' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to add planning capabilities on projects', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton project planning', - package_dir={'trytond.modules.project_plan': '.'}, - packages=( - ['trytond.modules.project_plan'] - + ['trytond.modules.project_plan.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.project_plan': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - project_plan = trytond.modules.project_plan - """, - ) diff --git a/modules/project_plan/tox.ini b/modules/project_plan/tox.ini index 53e3ce4cf0..57236f5028 100644 --- a/modules/project_plan/tox.ini +++ b/modules/project_plan/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.project_plan --omit=*/tests/* -m xmlrunner discover -s trytond.modules.project_plan {posargs} commands_post = coverage report coverage xml diff --git a/modules/project_revenue/COPYRIGHT b/modules/project_revenue/COPYRIGHT index 8077ed4a15..a1de6d1e27 100644 --- a/modules/project_revenue/COPYRIGHT +++ b/modules/project_revenue/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/project_revenue/MANIFEST.in b/modules/project_revenue/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/project_revenue/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/project_revenue/doc/conf.py b/modules/project_revenue/doc/conf.py index 33103511c6..b6afe6ca8f 100644 --- a/modules/project_revenue/doc/conf.py +++ b/modules/project_revenue/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/project_revenue/doc/requirements-doc.txt b/modules/project_revenue/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/project_revenue/doc/requirements-doc.txt +++ b/modules/project_revenue/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/project_revenue/pyproject.toml b/modules/project_revenue/pyproject.toml new file mode 100644 index 0000000000..d76ebab70b --- /dev/null +++ b/modules/project_revenue/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_project_revenue' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Project revenue for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "project"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +project_revenue = 'trytond.modules.project_revenue' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-project-revenue/" +changelog = "https://docs.tryton.org/modules-project-revenue/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/project_revenue" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/project_revenue/setup.py b/modules/project_revenue/setup.py deleted file mode 100755 index 70a1acc912..0000000000 --- a/modules/project_revenue/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_project_revenue' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_purchase')] - -setup(name=name, - version=version, - description='Tryton module to add revenue on project', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton project revenue', - package_dir={'trytond.modules.project_revenue': '.'}, - packages=( - ['trytond.modules.project_revenue'] - + ['trytond.modules.project_revenue.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.project_revenue': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - project_revenue = trytond.modules.project_revenue - """, - ) diff --git a/modules/project_revenue/tox.ini b/modules/project_revenue/tox.ini index 53e3ce4cf0..f7dca93d54 100644 --- a/modules/project_revenue/tox.ini +++ b/modules/project_revenue/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.project_revenue --omit=*/tests/* -m xmlrunner discover -s trytond.modules.project_revenue {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase/COPYRIGHT b/modules/purchase/COPYRIGHT index 2babb3e0a8..e35e734acd 100644 --- a/modules/purchase/COPYRIGHT +++ b/modules/purchase/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase/MANIFEST.in b/modules/purchase/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase/doc/conf.py b/modules/purchase/doc/conf.py index d661f3f805..e89bc85df3 100644 --- a/modules/purchase/doc/conf.py +++ b/modules/purchase/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase/doc/requirements-doc.txt b/modules/purchase/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase/doc/requirements-doc.txt +++ b/modules/purchase/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase/pyproject.toml b/modules/purchase/pyproject.toml new file mode 100644 index 0000000000..2a326e18b2 --- /dev/null +++ b/modules/purchase/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Purchases for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase = 'trytond.modules.purchase' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase/" +changelog = "https://docs.tryton.org/modules-purchase/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/purchase/setup.py b/modules/purchase/setup.py deleted file mode 100755 index c9b3e67ef2..0000000000 --- a/modules/purchase/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for purchase', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-purchase/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase', - package_dir={'trytond.modules.purchase': '.'}, - packages=( - ['trytond.modules.purchase'] - + ['trytond.modules.purchase.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst', - '*.fodt', 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase = trytond.modules.purchase - """, - ) diff --git a/modules/purchase/tox.ini b/modules/purchase/tox.ini index 53e3ce4cf0..be0423c65f 100644 --- a/modules/purchase/tox.ini +++ b/modules/purchase/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_amendment/COPYRIGHT b/modules/purchase_amendment/COPYRIGHT index 1619cbe94c..da74ed2975 100644 --- a/modules/purchase_amendment/COPYRIGHT +++ b/modules/purchase_amendment/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2019-2025 B2CK -Copyright (C) 2019-2025 Cédric Krier +Copyright (C) 2019-2025 B2CK SRL +Copyright (C) 2019-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase_amendment/MANIFEST.in b/modules/purchase_amendment/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_amendment/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_amendment/doc/conf.py b/modules/purchase_amendment/doc/conf.py index d81794f361..9a023dd1ad 100644 --- a/modules/purchase_amendment/doc/conf.py +++ b/modules/purchase_amendment/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_amendment/doc/requirements-doc.txt b/modules/purchase_amendment/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_amendment/doc/requirements-doc.txt +++ b/modules/purchase_amendment/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_amendment/pyproject.toml b/modules/purchase_amendment/pyproject.toml new file mode 100644 index 0000000000..b0dc4d942b --- /dev/null +++ b/modules/purchase_amendment/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_amendment' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Purchase amendments for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_amendment = 'trytond.modules.purchase_amendment' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-amendment/" +changelog = "https://docs.tryton.org/modules-purchase-amendment/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_amendment" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/purchase_amendment/setup.py b/modules/purchase_amendment/setup.py deleted file mode 100755 index 380f723658..0000000000 --- a/modules/purchase_amendment/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_amendment' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to amend purchases', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase amendment', - package_dir={'trytond.modules.purchase_amendment': '.'}, - packages=( - ['trytond.modules.purchase_amendment'] - + ['trytond.modules.purchase_amendment.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_amendment': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_amendment = trytond.modules.purchase_amendment - """, - ) diff --git a/modules/purchase_amendment/tox.ini b/modules/purchase_amendment/tox.ini index 53e3ce4cf0..3930e1fc51 100644 --- a/modules/purchase_amendment/tox.ini +++ b/modules/purchase_amendment/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_amendment --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_amendment {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_blanket_agreement/COPYRIGHT b/modules/purchase_blanket_agreement/COPYRIGHT index a36a263ca4..95cadd4492 100644 --- a/modules/purchase_blanket_agreement/COPYRIGHT +++ b/modules/purchase_blanket_agreement/COPYRIGHT @@ -2,8 +2,8 @@ Copyright (C) 2021 Hashbang Copyright (C) 2021-2025 Maxime Richez Copyright (C) 2021-2025 SALUC SA Copyright (C) 2021 Thierry Bruyere -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase_blanket_agreement/MANIFEST.in b/modules/purchase_blanket_agreement/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_blanket_agreement/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_blanket_agreement/README.rst b/modules/purchase_blanket_agreement/README.rst deleted file mode 100644 index 176d9c2695..0000000000 --- a/modules/purchase_blanket_agreement/README.rst +++ /dev/null @@ -1 +0,0 @@ -doc/index.rst \ No newline at end of file diff --git a/modules/purchase_blanket_agreement/README.rst b/modules/purchase_blanket_agreement/README.rst new file mode 120000 index 0000000000..176d9c2695 --- /dev/null +++ b/modules/purchase_blanket_agreement/README.rst @@ -0,0 +1 @@ +doc/index.rst \ No newline at end of file diff --git a/modules/purchase_blanket_agreement/doc/conf.py b/modules/purchase_blanket_agreement/doc/conf.py index cc82137a63..24247a443a 100644 --- a/modules/purchase_blanket_agreement/doc/conf.py +++ b/modules/purchase_blanket_agreement/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_blanket_agreement/doc/requirements-doc.txt b/modules/purchase_blanket_agreement/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_blanket_agreement/doc/requirements-doc.txt +++ b/modules/purchase_blanket_agreement/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_blanket_agreement/pyproject.toml b/modules/purchase_blanket_agreement/pyproject.toml new file mode 100644 index 0000000000..569aeacc0d --- /dev/null +++ b/modules/purchase_blanket_agreement/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_blanket_agreement' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Purchase blanket agreements for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_blanket_agreement = 'trytond.modules.purchase_blanket_agreement' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-blanket-agreement/" +changelog = "https://docs.tryton.org/modules-purchase-blanket-agreement/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_blanket_agreement" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/purchase_blanket_agreement/setup.py b/modules/purchase_blanket_agreement/setup.py deleted file mode 100755 index 5664a5ced6..0000000000 --- a/modules/purchase_blanket_agreement/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_blanket_agreement' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - ] - -setup(name=name, - version=version, - description='Tryton module for purchase blanket agreement', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": - 'https://docs.tryton.org/modules-purchase-blanket-agreement', # noqa: E501 - "Forum": 'https://www.tryton.org/forum', - "Source Code": - 'https://hg.tryton.org/modules/purchase_blanket_agreement', - }, - keywords='tryton, blanket agreement, purchase', - package_dir={'trytond.modules.purchase_blanket_agreement': '.'}, - packages=( - ['trytond.modules.purchase_blanket_agreement'] - + ['trytond.modules.purchase_blanket_agreement.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_blanket_agreement': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_blanket_agreement = trytond.modules.purchase_blanket_agreement - """, # noqa: E501 - ) diff --git a/modules/purchase_blanket_agreement/tox.ini b/modules/purchase_blanket_agreement/tox.ini index 53e3ce4cf0..8587b23dd9 100644 --- a/modules/purchase_blanket_agreement/tox.ini +++ b/modules/purchase_blanket_agreement/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_blanket_agreement --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_blanket_agreement {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_history/COPYRIGHT b/modules/purchase_history/COPYRIGHT index 1619cbe94c..da74ed2975 100644 --- a/modules/purchase_history/COPYRIGHT +++ b/modules/purchase_history/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2019-2025 B2CK -Copyright (C) 2019-2025 Cédric Krier +Copyright (C) 2019-2025 B2CK SRL +Copyright (C) 2019-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase_history/MANIFEST.in b/modules/purchase_history/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_history/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_history/doc/conf.py b/modules/purchase_history/doc/conf.py index 4bdfa12ec1..8cdb8db634 100644 --- a/modules/purchase_history/doc/conf.py +++ b/modules/purchase_history/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_history/doc/requirements-doc.txt b/modules/purchase_history/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_history/doc/requirements-doc.txt +++ b/modules/purchase_history/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_history/pyproject.toml b/modules/purchase_history/pyproject.toml new file mode 100644 index 0000000000..fdea603ed2 --- /dev/null +++ b/modules/purchase_history/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_history' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Purchases history for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_history = 'trytond.modules.purchase_history' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-history/" +changelog = "https://docs.tryton.org/modules-purchase-history/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_history" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/purchase_history/setup.py b/modules/purchase_history/setup.py deleted file mode 100755 index b3daba81f4..0000000000 --- a/modules/purchase_history/setup.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_history' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to historize purchases', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase history revision', - package_dir={'trytond.modules.purchase_history': '.'}, - packages=( - ['trytond.modules.purchase_history'] - + ['trytond.modules.purchase_history.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_history': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_history = trytond.modules.purchase_history - """, - ) diff --git a/modules/purchase_history/tox.ini b/modules/purchase_history/tox.ini index 53e3ce4cf0..bf84268f4a 100644 --- a/modules/purchase_history/tox.ini +++ b/modules/purchase_history/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_history --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_history {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_invoice_line_standalone/COPYRIGHT b/modules/purchase_invoice_line_standalone/COPYRIGHT index a392859693..dc839cb31b 100644 --- a/modules/purchase_invoice_line_standalone/COPYRIGHT +++ b/modules/purchase_invoice_line_standalone/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase_invoice_line_standalone/MANIFEST.in b/modules/purchase_invoice_line_standalone/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_invoice_line_standalone/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_invoice_line_standalone/doc/conf.py b/modules/purchase_invoice_line_standalone/doc/conf.py index d18a3d09bf..52bbf81b03 100644 --- a/modules/purchase_invoice_line_standalone/doc/conf.py +++ b/modules/purchase_invoice_line_standalone/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_invoice_line_standalone/doc/requirements-doc.txt b/modules/purchase_invoice_line_standalone/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_invoice_line_standalone/doc/requirements-doc.txt +++ b/modules/purchase_invoice_line_standalone/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_invoice_line_standalone/pyproject.toml b/modules/purchase_invoice_line_standalone/pyproject.toml new file mode 100644 index 0000000000..17f0842d77 --- /dev/null +++ b/modules/purchase_invoice_line_standalone/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_invoice_line_standalone' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Standalone invoice lines from purchases for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_invoice_line_standalone = 'trytond.modules.purchase_invoice_line_standalone' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-invoice-line-standalone/" +changelog = "https://docs.tryton.org/modules-purchase-invoice-line-standalone/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_invoice_line_standalone" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/purchase_invoice_line_standalone/setup.py b/modules/purchase_invoice_line_standalone/setup.py deleted file mode 100755 index 885842b5f8..0000000000 --- a/modules/purchase_invoice_line_standalone/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_invoice_line_standalone' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for standalone invoice line from purchase', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase standalone invoice line', - package_dir={'trytond.modules.purchase_invoice_line_standalone': '.'}, - packages=( - ['trytond.modules.purchase_invoice_line_standalone'] - + ['trytond.modules.purchase_invoice_line_standalone.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_invoice_line_standalone': ( - info.get('xml', []) + ['tryton.cfg', 'view/*.xml', 'locale/*.po', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_invoice_line_standalone = \ - trytond.modules.purchase_invoice_line_standalone - """, - ) diff --git a/modules/purchase_invoice_line_standalone/tox.ini b/modules/purchase_invoice_line_standalone/tox.ini index 53e3ce4cf0..837975f1cc 100644 --- a/modules/purchase_invoice_line_standalone/tox.ini +++ b/modules/purchase_invoice_line_standalone/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_invoice_line_standalone --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_invoice_line_standalone {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_price_list/COPYRIGHT b/modules/purchase_price_list/COPYRIGHT index 26cedee5ea..83cca03ba3 100644 --- a/modules/purchase_price_list/COPYRIGHT +++ b/modules/purchase_price_list/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase_price_list/MANIFEST.in b/modules/purchase_price_list/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_price_list/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_price_list/doc/conf.py b/modules/purchase_price_list/doc/conf.py index 84f9622ab1..d73359baea 100644 --- a/modules/purchase_price_list/doc/conf.py +++ b/modules/purchase_price_list/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_price_list/doc/requirements-doc.txt b/modules/purchase_price_list/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_price_list/doc/requirements-doc.txt +++ b/modules/purchase_price_list/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_price_list/pyproject.toml b/modules/purchase_price_list/pyproject.toml new file mode 100644 index 0000000000..0fc361bdf2 --- /dev/null +++ b/modules/purchase_price_list/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_price_list' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Purchase price lists for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_price_list = 'trytond.modules.purchase_price_list' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-price-list/" +changelog = "https://docs.tryton.org/modules-purchase-price-list/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_price_list" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/purchase_price_list/setup.py b/modules/purchase_price_list/setup.py deleted file mode 100755 index 02c3a90ae3..0000000000 --- a/modules/purchase_price_list/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_price_list' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to add price list on purchase', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-purchase-price-list'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase price list', - package_dir={'trytond.modules.purchase_price_list': '.'}, - packages=( - ['trytond.modules.purchase_price_list'] - + ['trytond.modules.purchase_price_list.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_price_list': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_price_list = trytond.modules.purchase_price_list - """, # noqa: E501 - ) diff --git a/modules/purchase_price_list/tox.ini b/modules/purchase_price_list/tox.ini index 53e3ce4cf0..3e97e75da0 100644 --- a/modules/purchase_price_list/tox.ini +++ b/modules/purchase_price_list/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_price_list --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_price_list {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_product_quantity/COPYRIGHT b/modules/purchase_product_quantity/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/purchase_product_quantity/COPYRIGHT +++ b/modules/purchase_product_quantity/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase_product_quantity/MANIFEST.in b/modules/purchase_product_quantity/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_product_quantity/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_product_quantity/doc/conf.py b/modules/purchase_product_quantity/doc/conf.py index 60c0a04b09..693ba2dc09 100644 --- a/modules/purchase_product_quantity/doc/conf.py +++ b/modules/purchase_product_quantity/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_product_quantity/doc/requirements-doc.txt b/modules/purchase_product_quantity/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_product_quantity/doc/requirements-doc.txt +++ b/modules/purchase_product_quantity/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_product_quantity/pyproject.toml b/modules/purchase_product_quantity/pyproject.toml new file mode 100644 index 0000000000..4ce3ffee3d --- /dev/null +++ b/modules/purchase_product_quantity/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_product_quantity' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Quantity constraints on purchases for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_product_quantity = 'trytond.modules.purchase_product_quantity' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-product-quantity/" +changelog = "https://docs.tryton.org/modules-purchase-product-quantity/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_product_quantity" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/purchase_product_quantity/setup.py b/modules/purchase_product_quantity/setup.py deleted file mode 100755 index a1e4e1c5d3..0000000000 --- a/modules/purchase_product_quantity/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_product_quantity' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_stock_supply'), - ] - -setup(name=name, - version=version, - description='Tryton module to add quantity constraints on purchase line', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-purchase-product-quantity'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase product quantity', - package_dir={'trytond.modules.purchase_product_quantity': '.'}, - packages=( - ['trytond.modules.purchase_product_quantity'] - + ['trytond.modules.purchase_product_quantity.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_product_quantity': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_product_quantity = trytond.modules.purchase_product_quantity - """, # noqa: E501 - ) diff --git a/modules/purchase_product_quantity/tox.ini b/modules/purchase_product_quantity/tox.ini index 53e3ce4cf0..293d7c1008 100644 --- a/modules/purchase_product_quantity/tox.ini +++ b/modules/purchase_product_quantity/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_product_quantity --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_product_quantity {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_request/COPYRIGHT b/modules/purchase_request/COPYRIGHT index 770d2c8de6..61f64262f2 100644 --- a/modules/purchase_request/COPYRIGHT +++ b/modules/purchase_request/COPYRIGHT @@ -1,8 +1,8 @@ -Copyright (C) 2016-2025 Nicolas Évrard. -Copyright (C) 2013-2015 NaN-tic. -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2016-2025 Nicolas Évrard +Copyright (C) 2013-2015 NaN-tic +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase_request/MANIFEST.in b/modules/purchase_request/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_request/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_request/doc/conf.py b/modules/purchase_request/doc/conf.py index 44206dfc5f..b30c6f468c 100644 --- a/modules/purchase_request/doc/conf.py +++ b/modules/purchase_request/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_request/doc/requirements-doc.txt b/modules/purchase_request/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_request/doc/requirements-doc.txt +++ b/modules/purchase_request/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_request/pyproject.toml b/modules/purchase_request/pyproject.toml new file mode 100644 index 0000000000..54074ad0b6 --- /dev/null +++ b/modules/purchase_request/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_request' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Purchase requests for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_request = 'trytond.modules.purchase_request' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-request/" +changelog = "https://docs.tryton.org/modules-purchase-request/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_request" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_stock_supply', + ] diff --git a/modules/purchase_request/setup.py b/modules/purchase_request/setup.py deleted file mode 100755 index a6454f6717..0000000000 --- a/modules/purchase_request/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_request' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('trytond_stock_supply'), - get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for purchase requests', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-purchase-request/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase request', - package_dir={'trytond.modules.purchase_request': '.'}, - packages=( - ['trytond.modules.purchase_request'] - + ['trytond.modules.purchase_request.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_request': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_request = trytond.modules.purchase_request - """, - ) diff --git a/modules/purchase_request/tox.ini b/modules/purchase_request/tox.ini index 53e3ce4cf0..a7953fc83b 100644 --- a/modules/purchase_request/tox.ini +++ b/modules/purchase_request/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_request --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_request {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_request_quotation/COPYRIGHT b/modules/purchase_request_quotation/COPYRIGHT index 789e82ade1..c4da38bd2a 100644 --- a/modules/purchase_request_quotation/COPYRIGHT +++ b/modules/purchase_request_quotation/COPYRIGHT @@ -1,8 +1,8 @@ Copyright (C) 2017-2021 Maxime Richez Copyright (C) 2017-2019 Thierry Bruyere Copyright (C) 2017-2021 SALUC SA -Copyright (C) 2018-2025 Cédric Krier -Copyright (C) 2018-2025 B2CK +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase_request_quotation/MANIFEST.in b/modules/purchase_request_quotation/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_request_quotation/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_request_quotation/doc/conf.py b/modules/purchase_request_quotation/doc/conf.py index 2851631845..36ec17d5a6 100644 --- a/modules/purchase_request_quotation/doc/conf.py +++ b/modules/purchase_request_quotation/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_request_quotation/doc/requirements-doc.txt b/modules/purchase_request_quotation/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_request_quotation/doc/requirements-doc.txt +++ b/modules/purchase_request_quotation/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_request_quotation/pyproject.toml b/modules/purchase_request_quotation/pyproject.toml new file mode 100644 index 0000000000..aeb3ea51b8 --- /dev/null +++ b/modules/purchase_request_quotation/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_request_quotation' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Quotation of purchase requests for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_request_quotation = 'trytond.modules.purchase_request_quotation' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-request-quotation/" +changelog = "https://docs.tryton.org/modules-purchase-request-quotation/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_request_quotation" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/purchase_request_quotation/setup.py b/modules/purchase_request_quotation/setup.py deleted file mode 100755 index 454099833b..0000000000 --- a/modules/purchase_request_quotation/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part purchase_request_quotation module for Tryton. -# The COPYRIGHT file at the top level of this repository contains - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_request_quotation' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_purchase_requisition'), - ] - -setup(name=name, - version=version, - description='Tryton module for purchase request quotation', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-purchase-request-quotation/'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase request for quotation', - package_dir={'trytond.modules.purchase_request_quotation': '.'}, - packages=( - ['trytond.modules.purchase_request_quotation'] - + ['trytond.modules.purchase_request_quotation.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_request_quotation': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_request_quotation = trytond.modules.purchase_request_quotation - """, - ) diff --git a/modules/purchase_request_quotation/tox.ini b/modules/purchase_request_quotation/tox.ini index 53e3ce4cf0..3c5946b788 100644 --- a/modules/purchase_request_quotation/tox.ini +++ b/modules/purchase_request_quotation/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_request_quotation --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_request_quotation {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_requisition/MANIFEST.in b/modules/purchase_requisition/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_requisition/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_requisition/doc/conf.py b/modules/purchase_requisition/doc/conf.py index 809553f3bc..52f04c343f 100644 --- a/modules/purchase_requisition/doc/conf.py +++ b/modules/purchase_requisition/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_requisition/doc/requirements-doc.txt b/modules/purchase_requisition/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_requisition/doc/requirements-doc.txt +++ b/modules/purchase_requisition/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_requisition/pyproject.toml b/modules/purchase_requisition/pyproject.toml new file mode 100644 index 0000000000..30966e5277 --- /dev/null +++ b/modules/purchase_requisition/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_requisition' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Purchase requisitions for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_requisition = 'trytond.modules.purchase_requisition' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-requisition/" +changelog = "https://docs.tryton.org/modules-purchase-requisition/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_requisition" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/purchase_requisition/setup.py b/modules/purchase_requisition/setup.py deleted file mode 100755 index 6b94a4bc2e..0000000000 --- a/modules/purchase_requisition/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_requisition' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description=('Allows users to enter requests for product supply ' - '(requisition). This will create a "Purchase request" by line ' - 'which will be treated by the purchasing department.'), - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase requisition', - package_dir={'trytond.modules.purchase_requisition': '.'}, - packages=( - ['trytond.modules.purchase_requisition'] - + ['trytond.modules.purchase_requisition.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_requisition': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_requisition = trytond.modules.purchase_requisition - """, - ) diff --git a/modules/purchase_requisition/tox.ini b/modules/purchase_requisition/tox.ini index 53e3ce4cf0..7a756678ed 100644 --- a/modules/purchase_requisition/tox.ini +++ b/modules/purchase_requisition/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_requisition --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_requisition {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_secondary_unit/COPYRIGHT b/modules/purchase_secondary_unit/COPYRIGHT index e42fe356fc..e7dd2b7778 100644 --- a/modules/purchase_secondary_unit/COPYRIGHT +++ b/modules/purchase_secondary_unit/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2019-2025 Cédric Krier -Copyright (C) 2019-2025 B2CK +Copyright (C) 2019-2025 Cédric Krier +Copyright (C) 2019-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase_secondary_unit/MANIFEST.in b/modules/purchase_secondary_unit/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_secondary_unit/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_secondary_unit/doc/conf.py b/modules/purchase_secondary_unit/doc/conf.py index 753efa1a44..15cd691273 100644 --- a/modules/purchase_secondary_unit/doc/conf.py +++ b/modules/purchase_secondary_unit/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_secondary_unit/doc/requirements-doc.txt b/modules/purchase_secondary_unit/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_secondary_unit/doc/requirements-doc.txt +++ b/modules/purchase_secondary_unit/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_secondary_unit/pyproject.toml b/modules/purchase_secondary_unit/pyproject.toml new file mode 100644 index 0000000000..3356e236f0 --- /dev/null +++ b/modules/purchase_secondary_unit/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_secondary_unit' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Secondary unit for purchases in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_secondary_unit = 'trytond.modules.purchase_secondary_unit' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-secondary-unit/" +changelog = "https://docs.tryton.org/modules-purchase-secondary-unit/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_secondary_unit" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/purchase_secondary_unit/setup.py b/modules/purchase_secondary_unit/setup.py deleted file mode 100755 index e661cff368..0000000000 --- a/modules/purchase_secondary_unit/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_secondary_unit' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_account_invoice_secondary_unit'), - get_require_version('trytond_purchase_amendment'), - get_require_version('trytond_purchase_blanket_agreement'), - get_require_version('trytond_purchase_request'), - get_require_version('trytond_purchase_requisition'), - get_require_version('trytond_stock_secondary_unit')] - -setup(name=name, - version=version, - description='Tryton module to add a secondary unit on purchase line', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase secondary unit', - package_dir={'trytond.modules.purchase_secondary_unit': '.'}, - packages=( - ['trytond.modules.purchase_secondary_unit'] - + ['trytond.modules.purchase_secondary_unit.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_secondary_unit': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_secondary_unit = trytond.modules.purchase_secondary_unit - """, - ) diff --git a/modules/purchase_secondary_unit/tox.ini b/modules/purchase_secondary_unit/tox.ini index 53e3ce4cf0..573870edc5 100644 --- a/modules/purchase_secondary_unit/tox.ini +++ b/modules/purchase_secondary_unit/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_secondary_unit --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_secondary_unit {posargs} commands_post = coverage report coverage xml diff --git a/modules/purchase_shipment_cost/COPYRIGHT b/modules/purchase_shipment_cost/COPYRIGHT index 5f7aaf3ec4..eb112f245d 100644 --- a/modules/purchase_shipment_cost/COPYRIGHT +++ b/modules/purchase_shipment_cost/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2020 Bertrand Chenal. -Copyright (C) 2011-2025 Nicolas Évrard. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2020 Bertrand Chenal +Copyright (C) 2011-2025 Nicolas Évrard +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/purchase_shipment_cost/MANIFEST.in b/modules/purchase_shipment_cost/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/purchase_shipment_cost/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/purchase_shipment_cost/doc/conf.py b/modules/purchase_shipment_cost/doc/conf.py index f275cc17f8..5e4e31213e 100644 --- a/modules/purchase_shipment_cost/doc/conf.py +++ b/modules/purchase_shipment_cost/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/purchase_shipment_cost/doc/requirements-doc.txt b/modules/purchase_shipment_cost/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/purchase_shipment_cost/doc/requirements-doc.txt +++ b/modules/purchase_shipment_cost/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/purchase_shipment_cost/pyproject.toml b/modules/purchase_shipment_cost/pyproject.toml new file mode 100644 index 0000000000..f9998b530e --- /dev/null +++ b/modules/purchase_shipment_cost/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_purchase_shipment_cost' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shipment cost for purchases in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "purchase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +purchase_shipment_cost = 'trytond.modules.purchase_shipment_cost' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-purchase-shipment-cost/" +changelog = "https://docs.tryton.org/modules-purchase-shipment-cost/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/purchase_shipment_cost" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_purchase', + ] diff --git a/modules/purchase_shipment_cost/setup.py b/modules/purchase_shipment_cost/setup.py deleted file mode 100755 index 8ab6177c54..0000000000 --- a/modules/purchase_shipment_cost/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_purchase_shipment_cost' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_account_invoice_stock'), - get_require_version('trytond_account_stock_continental'), - get_require_version('trytond_account_stock_anglo_saxon'), - get_require_version('trytond_purchase')] - -setup(name=name, - version=version, - description='Tryton module for purchase shipment cost', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton purchase shipment cost', - package_dir={'trytond.modules.purchase_shipment_cost': '.'}, - packages=( - ['trytond.modules.purchase_shipment_cost'] - + ['trytond.modules.purchase_shipment_cost.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.purchase_shipment_cost': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - purchase_shipment_cost = trytond.modules.purchase_shipment_cost - """, - ) diff --git a/modules/purchase_shipment_cost/tox.ini b/modules/purchase_shipment_cost/tox.ini index 53e3ce4cf0..371eb4d985 100644 --- a/modules/purchase_shipment_cost/tox.ini +++ b/modules/purchase_shipment_cost/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.purchase_shipment_cost --omit=*/tests/* -m xmlrunner discover -s trytond.modules.purchase_shipment_cost {posargs} commands_post = coverage report coverage xml diff --git a/modules/quality/COPYRIGHT b/modules/quality/COPYRIGHT index c0f8c54da4..928ba3fa34 100644 --- a/modules/quality/COPYRIGHT +++ b/modules/quality/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2023-2025 B2CK -Copyright (C) 2023-2025 Cédric Krier -Copyright (C) 2021-2024 Sergi Almacellas Abellana +Copyright (C) 2023-2025 B2CK SRL +Copyright (C) 2023-2025 Cédric Krier +Copyright (C) 2021-2024 Sergi Almacellas Abellana This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/quality/MANIFEST.in b/modules/quality/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/quality/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/quality/doc/conf.py b/modules/quality/doc/conf.py index f8047ebc65..55040ca36c 100644 --- a/modules/quality/doc/conf.py +++ b/modules/quality/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/quality/doc/requirements-doc.txt b/modules/quality/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/quality/doc/requirements-doc.txt +++ b/modules/quality/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/quality/pyproject.toml b/modules/quality/pyproject.toml new file mode 100644 index 0000000000..a0555d6693 --- /dev/null +++ b/modules/quality/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_quality' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Quality management for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "quality"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +quality = 'trytond.modules.quality' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-quality/" +changelog = "https://docs.tryton.org/modules-quality/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/quality" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/quality/setup.py b/modules/quality/setup.py deleted file mode 100755 index 13e593f8cd..0000000000 --- a/modules/quality/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_quality' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_stock'), - get_require_version('trytond_production'), - ] - -setup(name=name, - version=version, - description='Quality Management', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-quality', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton quality QMS inspection', - package_dir={'trytond.modules.quality': '.'}, - packages=( - ['trytond.modules.quality'] - + ['trytond.modules.quality.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.quality': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - quality = trytond.modules.quality - """, # noqa: E501 - ) diff --git a/modules/quality/tox.ini b/modules/quality/tox.ini index 53e3ce4cf0..685d12309b 100644 --- a/modules/quality/tox.ini +++ b/modules/quality/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.quality --omit=*/tests/* -m xmlrunner discover -s trytond.modules.quality {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale/COPYRIGHT b/modules/sale/COPYRIGHT index 2babb3e0a8..e35e734acd 100644 --- a/modules/sale/COPYRIGHT +++ b/modules/sale/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale/MANIFEST.in b/modules/sale/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale/doc/conf.py b/modules/sale/doc/conf.py index 909b1d8eb3..aa1de63858 100644 --- a/modules/sale/doc/conf.py +++ b/modules/sale/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale/doc/requirements-doc.txt b/modules/sale/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale/doc/requirements-doc.txt +++ b/modules/sale/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale/pyproject.toml b/modules/sale/pyproject.toml new file mode 100644 index 0000000000..3d76f151a8 --- /dev/null +++ b/modules/sale/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale = 'trytond.modules.sale' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale/" +changelog = "https://docs.tryton.org/modules-sale/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-dateutil', + 'python-sql >= 0.4', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale/setup.py b/modules/sale/setup.py deleted file mode 100755 index f6844177ec..0000000000 --- a/modules/sale/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4', 'python-dateutil'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for sale', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-sale/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale', - package_dir={'trytond.modules.sale': '.'}, - packages=( - ['trytond.modules.sale'] - + ['trytond.modules.sale.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'tests/*.rst', 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale = trytond.modules.sale - """, - ) diff --git a/modules/sale/tox.ini b/modules/sale/tox.ini index 53e3ce4cf0..dea4bf3020 100644 --- a/modules/sale/tox.ini +++ b/modules/sale/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_advance_payment/COPYRIGHT b/modules/sale_advance_payment/COPYRIGHT index f15b3d4899..21800ab1bd 100644 --- a/modules/sale_advance_payment/COPYRIGHT +++ b/modules/sale_advance_payment/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2015-2025 Nicolas Évrard. -Copyright (C) 2017-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Nicolas Évrard +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_advance_payment/MANIFEST.in b/modules/sale_advance_payment/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_advance_payment/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_advance_payment/doc/conf.py b/modules/sale_advance_payment/doc/conf.py index f83147a25b..f0be5e708d 100644 --- a/modules/sale_advance_payment/doc/conf.py +++ b/modules/sale_advance_payment/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_advance_payment/doc/requirements-doc.txt b/modules/sale_advance_payment/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_advance_payment/doc/requirements-doc.txt +++ b/modules/sale_advance_payment/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_advance_payment/pyproject.toml b/modules/sale_advance_payment/pyproject.toml new file mode 100644 index 0000000000..27b6cc4e82 --- /dev/null +++ b/modules/sale_advance_payment/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_advance_payment' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Advance payments for sales in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_advance_payment = 'trytond.modules.sale_advance_payment' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-advance-payment/" +changelog = "https://docs.tryton.org/modules-sale-advance-payment/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_advance_payment" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['simpleeval'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_advance_payment/setup.py b/modules/sale_advance_payment/setup.py deleted file mode 100755 index bf7e9bfd56..0000000000 --- a/modules/sale_advance_payment/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_advance_payment' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['simpleeval'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] -for dep in ['sale_supply']: - tests_require.append(get_require_version('trytond_%s' % dep)) - -setup(name=name, - version=version, - description='Tryton module for sale advance payment', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-sale-advance-payment/'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale advance payment', - package_dir={'trytond.modules.sale_advance_payment': '.'}, - packages=( - ['trytond.modules.sale_advance_payment'] - + ['trytond.modules.sale_advance_payment.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_advance_payment': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_advance_payment = trytond.modules.sale_advance_payment - """, - ) diff --git a/modules/sale_advance_payment/tox.ini b/modules/sale_advance_payment/tox.ini index 53e3ce4cf0..9d96665ea6 100644 --- a/modules/sale_advance_payment/tox.ini +++ b/modules/sale_advance_payment/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_advance_payment --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_advance_payment {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_amendment/COPYRIGHT b/modules/sale_amendment/COPYRIGHT index 1619cbe94c..da74ed2975 100644 --- a/modules/sale_amendment/COPYRIGHT +++ b/modules/sale_amendment/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2019-2025 B2CK -Copyright (C) 2019-2025 Cédric Krier +Copyright (C) 2019-2025 B2CK SRL +Copyright (C) 2019-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_amendment/MANIFEST.in b/modules/sale_amendment/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_amendment/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_amendment/doc/conf.py b/modules/sale_amendment/doc/conf.py index 3c1c6fc275..3ab641f8a0 100644 --- a/modules/sale_amendment/doc/conf.py +++ b/modules/sale_amendment/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_amendment/doc/requirements-doc.txt b/modules/sale_amendment/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_amendment/doc/requirements-doc.txt +++ b/modules/sale_amendment/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_amendment/pyproject.toml b/modules/sale_amendment/pyproject.toml new file mode 100644 index 0000000000..fd9e2b2c32 --- /dev/null +++ b/modules/sale_amendment/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_amendment' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale amendments for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_amendment = 'trytond.modules.sale_amendment' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-amendment/" +changelog = "https://docs.tryton.org/modules-sale-amendment/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_amendment" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_amendment/setup.py b/modules/sale_amendment/setup.py deleted file mode 100755 index 71438a3294..0000000000 --- a/modules/sale_amendment/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_amendment' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to amend sales', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale amendment', - package_dir={'trytond.modules.sale_amendment': '.'}, - packages=( - ['trytond.modules.sale_amendment'] - + ['trytond.modules.sale_amendment.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_amendment': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_amendment = trytond.modules.sale_amendment - """, - ) diff --git a/modules/sale_amendment/tox.ini b/modules/sale_amendment/tox.ini index 53e3ce4cf0..f5cd3ce7b0 100644 --- a/modules/sale_amendment/tox.ini +++ b/modules/sale_amendment/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_amendment --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_amendment {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_blanket_agreement/COPYRIGHT b/modules/sale_blanket_agreement/COPYRIGHT index a36a263ca4..95cadd4492 100644 --- a/modules/sale_blanket_agreement/COPYRIGHT +++ b/modules/sale_blanket_agreement/COPYRIGHT @@ -2,8 +2,8 @@ Copyright (C) 2021 Hashbang Copyright (C) 2021-2025 Maxime Richez Copyright (C) 2021-2025 SALUC SA Copyright (C) 2021 Thierry Bruyere -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_blanket_agreement/MANIFEST.in b/modules/sale_blanket_agreement/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_blanket_agreement/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_blanket_agreement/README.rst b/modules/sale_blanket_agreement/README.rst deleted file mode 100644 index 176d9c2695..0000000000 --- a/modules/sale_blanket_agreement/README.rst +++ /dev/null @@ -1 +0,0 @@ -doc/index.rst \ No newline at end of file diff --git a/modules/sale_blanket_agreement/README.rst b/modules/sale_blanket_agreement/README.rst new file mode 120000 index 0000000000..176d9c2695 --- /dev/null +++ b/modules/sale_blanket_agreement/README.rst @@ -0,0 +1 @@ +doc/index.rst \ No newline at end of file diff --git a/modules/sale_blanket_agreement/doc/conf.py b/modules/sale_blanket_agreement/doc/conf.py index efdd5be4fb..bcbd21abd6 100644 --- a/modules/sale_blanket_agreement/doc/conf.py +++ b/modules/sale_blanket_agreement/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_blanket_agreement/doc/requirements-doc.txt b/modules/sale_blanket_agreement/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_blanket_agreement/doc/requirements-doc.txt +++ b/modules/sale_blanket_agreement/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_blanket_agreement/pyproject.toml b/modules/sale_blanket_agreement/pyproject.toml new file mode 100644 index 0000000000..3261b1ce73 --- /dev/null +++ b/modules/sale_blanket_agreement/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_blanket_agreement' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale blanket agreements for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_blanket_agreement = 'trytond.modules.sale_blanket_agreement' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-blanket-agreement/" +changelog = "https://docs.tryton.org/modules-sale-blanket-agreement/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_blanket_agreement" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_blanket_agreement/setup.py b/modules/sale_blanket_agreement/setup.py deleted file mode 100755 index e526631a0c..0000000000 --- a/modules/sale_blanket_agreement/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_blanket_agreement' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - ] - -setup(name=name, - version=version, - description='Tryton module for sale blanket agreement', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": - 'https://docs.tryton.org/modules-sale-blanket-agreement', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton, blanket agreement, sale', - package_dir={'trytond.modules.sale_blanket_agreement': '.'}, - packages=( - ['trytond.modules.sale_blanket_agreement'] - + ['trytond.modules.sale_blanket_agreement.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_blanket_agreement': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_blanket_agreement = trytond.modules.sale_blanket_agreement - """, # noqa: E501 - ) diff --git a/modules/sale_blanket_agreement/tox.ini b/modules/sale_blanket_agreement/tox.ini index 53e3ce4cf0..b5a50d24b2 100644 --- a/modules/sale_blanket_agreement/tox.ini +++ b/modules/sale_blanket_agreement/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_blanket_agreement --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_blanket_agreement {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_complaint/COPYRIGHT b/modules/sale_complaint/COPYRIGHT index 027b10a997..6c34774f53 100644 --- a/modules/sale_complaint/COPYRIGHT +++ b/modules/sale_complaint/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_complaint/MANIFEST.in b/modules/sale_complaint/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_complaint/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_complaint/doc/conf.py b/modules/sale_complaint/doc/conf.py index 32899ee543..2c347f332e 100644 --- a/modules/sale_complaint/doc/conf.py +++ b/modules/sale_complaint/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_complaint/doc/requirements-doc.txt b/modules/sale_complaint/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_complaint/doc/requirements-doc.txt +++ b/modules/sale_complaint/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_complaint/pyproject.toml b/modules/sale_complaint/pyproject.toml new file mode 100644 index 0000000000..2c6cf3f7de --- /dev/null +++ b/modules/sale_complaint/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_complaint' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale complaints for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_complaint = 'trytond.modules.sale_complaint' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-complaint/" +changelog = "https://docs.tryton.org/modules-sale-complaint/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_complaint" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_complaint/setup.py b/modules/sale_complaint/setup.py deleted file mode 100755 index 92a34e7f6d..0000000000 --- a/modules/sale_complaint/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_complaint' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale_promotion_coupon'), - ] - -setup(name=name, - version=version, - description='Tryton module for sale complaint', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale customer complaint', - package_dir={'trytond.modules.sale_complaint': '.'}, - packages=( - ['trytond.modules.sale_complaint'] - + ['trytond.modules.sale_complaint.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_complaint': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_complaint = trytond.modules.sale_complaint - """, - ) diff --git a/modules/sale_complaint/tox.ini b/modules/sale_complaint/tox.ini index 53e3ce4cf0..76f58ccc9f 100644 --- a/modules/sale_complaint/tox.ini +++ b/modules/sale_complaint/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_complaint --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_complaint {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_credit_limit/COPYRIGHT b/modules/sale_credit_limit/COPYRIGHT index d61e4ef396..10c8c55375 100644 --- a/modules/sale_credit_limit/COPYRIGHT +++ b/modules/sale_credit_limit/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_credit_limit/MANIFEST.in b/modules/sale_credit_limit/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_credit_limit/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_credit_limit/doc/conf.py b/modules/sale_credit_limit/doc/conf.py index ddf46cd539..4dbb8427b7 100644 --- a/modules/sale_credit_limit/doc/conf.py +++ b/modules/sale_credit_limit/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_credit_limit/doc/requirements-doc.txt b/modules/sale_credit_limit/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_credit_limit/doc/requirements-doc.txt +++ b/modules/sale_credit_limit/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_credit_limit/pyproject.toml b/modules/sale_credit_limit/pyproject.toml new file mode 100644 index 0000000000..226526be5a --- /dev/null +++ b/modules/sale_credit_limit/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_credit_limit' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale credit limits for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_credit_limit = 'trytond.modules.sale_credit_limit' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-credit-limit/" +changelog = "https://docs.tryton.org/modules-sale-credit-limit/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_credit_limit" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/sale_credit_limit/setup.py b/modules/sale_credit_limit/setup.py deleted file mode 100755 index 00dee1e6e0..0000000000 --- a/modules/sale_credit_limit/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_credit_limit' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module for sale credit limit', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale credit limit', - package_dir={'trytond.modules.sale_credit_limit': '.'}, - packages=( - ['trytond.modules.sale_credit_limit'] - + ['trytond.modules.sale_credit_limit.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_credit_limit': (info.get('xml', []) - + ['tryton.cfg', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_credit_limit = trytond.modules.sale_credit_limit - """, - ) diff --git a/modules/sale_credit_limit/tox.ini b/modules/sale_credit_limit/tox.ini index 53e3ce4cf0..9dcabc41a8 100644 --- a/modules/sale_credit_limit/tox.ini +++ b/modules/sale_credit_limit/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_credit_limit --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_credit_limit {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_discount/COPYRIGHT b/modules/sale_discount/COPYRIGHT index f85dc624b4..01cea9b9c1 100644 --- a/modules/sale_discount/COPYRIGHT +++ b/modules/sale_discount/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2020-2025 B2CK -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL +Copyright (C) 2020-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_discount/MANIFEST.in b/modules/sale_discount/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_discount/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_discount/doc/conf.py b/modules/sale_discount/doc/conf.py index abb65f322f..2e56da5706 100644 --- a/modules/sale_discount/doc/conf.py +++ b/modules/sale_discount/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_discount/doc/requirements-doc.txt b/modules/sale_discount/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_discount/doc/requirements-doc.txt +++ b/modules/sale_discount/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_discount/pyproject.toml b/modules/sale_discount/pyproject.toml new file mode 100644 index 0000000000..19dedbcd4b --- /dev/null +++ b/modules/sale_discount/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_discount' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale discounts for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_discount = 'trytond.modules.sale_discount' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-discount/" +changelog = "https://docs.tryton.org/modules-sale-discount/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_discount" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_discount/setup.py b/modules/sale_discount/setup.py deleted file mode 100755 index 148865a45a..0000000000 --- a/modules/sale_discount/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - if slice: - content = '\n'.join(content.splitlines()[slice]) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_discount' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module that manages discount on sale', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale discount', - package_dir={'trytond.modules.sale_discount': '.'}, - packages=( - ['trytond.modules.sale_discount'] - + ['trytond.modules.sale_discount.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_discount': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_discount = trytond.modules.sale_discount - """, # noqa: E501 - ) diff --git a/modules/sale_discount/tox.ini b/modules/sale_discount/tox.ini index 53e3ce4cf0..416b64c5fa 100644 --- a/modules/sale_discount/tox.ini +++ b/modules/sale_discount/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_discount --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_discount {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_extra/COPYRIGHT b/modules/sale_extra/COPYRIGHT index 027b10a997..6c34774f53 100644 --- a/modules/sale_extra/COPYRIGHT +++ b/modules/sale_extra/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_extra/MANIFEST.in b/modules/sale_extra/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_extra/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_extra/doc/conf.py b/modules/sale_extra/doc/conf.py index 4c8c26ec49..15f681b55d 100644 --- a/modules/sale_extra/doc/conf.py +++ b/modules/sale_extra/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_extra/doc/requirements-doc.txt b/modules/sale_extra/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_extra/doc/requirements-doc.txt +++ b/modules/sale_extra/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_extra/pyproject.toml b/modules/sale_extra/pyproject.toml new file mode 100644 index 0000000000..e8fa1a8635 --- /dev/null +++ b/modules/sale_extra/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_extra' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale extras for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_extra = 'trytond.modules.sale_extra' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-extra/" +changelog = "https://docs.tryton.org/modules-sale-extra/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_extra" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_extra/setup.py b/modules/sale_extra/setup.py deleted file mode 100755 index 4ce3d91203..0000000000 --- a/modules/sale_extra/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_extra' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for sale extra', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale extra premium cost', - package_dir={'trytond.modules.sale_extra': '.'}, - packages=( - ['trytond.modules.sale_extra'] - + ['trytond.modules.sale_extra.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_extra': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_extra = trytond.modules.sale_extra - """, - ) diff --git a/modules/sale_extra/tox.ini b/modules/sale_extra/tox.ini index 53e3ce4cf0..ac03f4b7b6 100644 --- a/modules/sale_extra/tox.ini +++ b/modules/sale_extra/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_extra --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_extra {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_gift_card/COPYRIGHT b/modules/sale_gift_card/COPYRIGHT index f85dc624b4..01cea9b9c1 100644 --- a/modules/sale_gift_card/COPYRIGHT +++ b/modules/sale_gift_card/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2020-2025 B2CK -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL +Copyright (C) 2020-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_gift_card/MANIFEST.in b/modules/sale_gift_card/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_gift_card/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_gift_card/doc/conf.py b/modules/sale_gift_card/doc/conf.py index 8eedd5c5c3..c59e14a7c2 100644 --- a/modules/sale_gift_card/doc/conf.py +++ b/modules/sale_gift_card/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_gift_card/doc/requirements-doc.txt b/modules/sale_gift_card/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_gift_card/doc/requirements-doc.txt +++ b/modules/sale_gift_card/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_gift_card/pyproject.toml b/modules/sale_gift_card/pyproject.toml new file mode 100644 index 0000000000..4c799fac1c --- /dev/null +++ b/modules/sale_gift_card/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_gift_card' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale gift cards for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_gift_card = 'trytond.modules.sale_gift_card' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-gift-card/" +changelog = "https://docs.tryton.org/modules-sale-gift-card/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + '**/*.html', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_gift_card" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_gift_card/setup.py b/modules/sale_gift_card/setup.py deleted file mode 100755 index d4ef7a84e9..0000000000 --- a/modules/sale_gift_card/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_gift_card' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale_point'), - ] - -setup(name=name, - version=version, - description="Tryton module to manage gift cards", - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale gift card', - package_dir={'trytond.modules.sale_gift_card': '.'}, - packages=( - ['trytond.modules.sale_gift_card'] - + ['trytond.modules.sale_gift_card.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_gift_card': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', '*.html', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_gift_card = trytond.modules.sale_gift_card - """, # noqa: E501 - ) diff --git a/modules/sale_gift_card/tox.ini b/modules/sale_gift_card/tox.ini index 53e3ce4cf0..67f07ada3f 100644 --- a/modules/sale_gift_card/tox.ini +++ b/modules/sale_gift_card/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_gift_card --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_gift_card {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_history/COPYRIGHT b/modules/sale_history/COPYRIGHT index 1619cbe94c..da74ed2975 100644 --- a/modules/sale_history/COPYRIGHT +++ b/modules/sale_history/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2019-2025 B2CK -Copyright (C) 2019-2025 Cédric Krier +Copyright (C) 2019-2025 B2CK SRL +Copyright (C) 2019-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_history/MANIFEST.in b/modules/sale_history/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_history/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_history/doc/conf.py b/modules/sale_history/doc/conf.py index 2202e64c1c..17c792fd37 100644 --- a/modules/sale_history/doc/conf.py +++ b/modules/sale_history/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_history/doc/requirements-doc.txt b/modules/sale_history/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_history/doc/requirements-doc.txt +++ b/modules/sale_history/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_history/pyproject.toml b/modules/sale_history/pyproject.toml new file mode 100644 index 0000000000..3e21a9ebb8 --- /dev/null +++ b/modules/sale_history/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_history' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale history for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_history = 'trytond.modules.sale_history' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-history/" +changelog = "https://docs.tryton.org/modules-sale-history/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_history" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_history/setup.py b/modules/sale_history/setup.py deleted file mode 100755 index 16d2d09fbc..0000000000 --- a/modules/sale_history/setup.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_history' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale_subscription'), - ] - -setup(name=name, - version=version, - description='Tryton module to historize sales', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale history revision', - package_dir={'trytond.modules.sale_history': '.'}, - packages=( - ['trytond.modules.sale_history'] - + ['trytond.modules.sale_history.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_history': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_history = trytond.modules.sale_history - """, - ) diff --git a/modules/sale_history/tox.ini b/modules/sale_history/tox.ini index 53e3ce4cf0..50a5ee49de 100644 --- a/modules/sale_history/tox.ini +++ b/modules/sale_history/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_history --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_history {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_invoice_date/COPYRIGHT b/modules/sale_invoice_date/COPYRIGHT index bb6a8a0544..e4a7445742 100644 --- a/modules/sale_invoice_date/COPYRIGHT +++ b/modules/sale_invoice_date/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_invoice_date/MANIFEST.in b/modules/sale_invoice_date/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_invoice_date/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_invoice_date/doc/conf.py b/modules/sale_invoice_date/doc/conf.py index 711debf7c1..2ba4f49be8 100644 --- a/modules/sale_invoice_date/doc/conf.py +++ b/modules/sale_invoice_date/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_invoice_date/doc/requirements-doc.txt b/modules/sale_invoice_date/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_invoice_date/doc/requirements-doc.txt +++ b/modules/sale_invoice_date/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_invoice_date/pyproject.toml b/modules/sale_invoice_date/pyproject.toml new file mode 100644 index 0000000000..cca21c0f55 --- /dev/null +++ b/modules/sale_invoice_date/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_invoice_date' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Invoice date for sale in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_invoice_date = 'trytond.modules.sale_invoice_date' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-invoice-date/" +changelog = "https://docs.tryton.org/modules-sale-invoice-date/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_invoice_date" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-dateutil'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_invoice_date/setup.py b/modules/sale_invoice_date/setup.py deleted file mode 100755 index eeb7ae95f3..0000000000 --- a/modules/sale_invoice_date/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_invoice_date' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-dateutil'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale_invoice_grouping'), - ] - -setup(name=name, - version=version, - description='Tryton module to compute invoice date of sale', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-sale-invoice-date'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale invoice date', - package_dir={'trytond.modules.sale_invoice_date': '.'}, - packages=( - ['trytond.modules.sale_invoice_date'] - + ['trytond.modules.sale_invoice_date.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_invoice_date': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_invoice_date = trytond.modules.sale_invoice_date - """, # noqa: E501 - ) diff --git a/modules/sale_invoice_date/tox.ini b/modules/sale_invoice_date/tox.ini index 53e3ce4cf0..4f4d66a011 100644 --- a/modules/sale_invoice_date/tox.ini +++ b/modules/sale_invoice_date/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_invoice_date --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_invoice_date {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_invoice_grouping/COPYRIGHT b/modules/sale_invoice_grouping/COPYRIGHT index ca0c9af3d1..cdbd9ea9d1 100644 --- a/modules/sale_invoice_grouping/COPYRIGHT +++ b/modules/sale_invoice_grouping/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2013-2025 Nicolas Évrard. -Copyright (C) 2013-2025 B2CK SPRL. +Copyright (C) 2013-2025 Nicolas Évrard +Copyright (C) 2013-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_invoice_grouping/MANIFEST.in b/modules/sale_invoice_grouping/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_invoice_grouping/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_invoice_grouping/doc/conf.py b/modules/sale_invoice_grouping/doc/conf.py index b9c59f8f91..cf740d5490 100644 --- a/modules/sale_invoice_grouping/doc/conf.py +++ b/modules/sale_invoice_grouping/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_invoice_grouping/doc/requirements-doc.txt b/modules/sale_invoice_grouping/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_invoice_grouping/doc/requirements-doc.txt +++ b/modules/sale_invoice_grouping/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_invoice_grouping/pyproject.toml b/modules/sale_invoice_grouping/pyproject.toml new file mode 100644 index 0000000000..5491b515a1 --- /dev/null +++ b/modules/sale_invoice_grouping/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_invoice_grouping' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Group invoices from sales in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale", "invoice"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_invoice_grouping = 'trytond.modules.sale_invoice_grouping' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-invoice-grouping/" +changelog = "https://docs.tryton.org/modules-sale-invoice-grouping/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_invoice_grouping" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_invoice_grouping/setup.py b/modules/sale_invoice_grouping/setup.py deleted file mode 100755 index b42a6a0b75..0000000000 --- a/modules/sale_invoice_grouping/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_invoice_grouping' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to group sale invoices', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale group invoice', - package_dir={'trytond.modules.sale_invoice_grouping': '.'}, - packages=( - ['trytond.modules.sale_invoice_grouping'] - + ['trytond.modules.sale_invoice_grouping.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_invoice_grouping': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_invoice_grouping = trytond.modules.sale_invoice_grouping - """, - ) diff --git a/modules/sale_invoice_grouping/tox.ini b/modules/sale_invoice_grouping/tox.ini index 53e3ce4cf0..09ead02bda 100644 --- a/modules/sale_invoice_grouping/tox.ini +++ b/modules/sale_invoice_grouping/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_invoice_grouping --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_invoice_grouping {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_opportunity/COPYRIGHT b/modules/sale_opportunity/COPYRIGHT index 5cc4f8296e..968ef545a6 100644 --- a/modules/sale_opportunity/COPYRIGHT +++ b/modules/sale_opportunity/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2010-2011 Open Labs Business Solutions. -Copyright (C) 2010-2025 Cédric Krier. -Copyright (C) 2010-2025 B2CK SPRL. +Copyright (C) 2010-2011 Open Labs Business Solutions +Copyright (C) 2010-2025 Cédric Krier +Copyright (C) 2010-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_opportunity/MANIFEST.in b/modules/sale_opportunity/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_opportunity/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_opportunity/doc/conf.py b/modules/sale_opportunity/doc/conf.py index aace2c12fd..2ee418ae0c 100644 --- a/modules/sale_opportunity/doc/conf.py +++ b/modules/sale_opportunity/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_opportunity/doc/requirements-doc.txt b/modules/sale_opportunity/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_opportunity/doc/requirements-doc.txt +++ b/modules/sale_opportunity/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_opportunity/pyproject.toml b/modules/sale_opportunity/pyproject.toml new file mode 100644 index 0000000000..7bac75cbf7 --- /dev/null +++ b/modules/sale_opportunity/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_opportunity' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Leads and opportunities for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_opportunity = 'trytond.modules.sale_opportunity' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-opportunity/" +changelog = "https://docs.tryton.org/modules-sale-opportunity/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_opportunity" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-dateutil', + 'python-sql >= 0.4', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_opportunity/setup.py b/modules/sale_opportunity/setup.py deleted file mode 100755 index cbef1f868c..0000000000 --- a/modules/sale_opportunity/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_opportunity' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4', 'python-dateutil'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module with leads and opportunities', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-sale-opportunity'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale opportunity', - package_dir={'trytond.modules.sale_opportunity': '.'}, - packages=( - ['trytond.modules.sale_opportunity'] - + ['trytond.modules.sale_opportunity.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_opportunity': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_opportunity = trytond.modules.sale_opportunity - """, - ) diff --git a/modules/sale_opportunity/tox.ini b/modules/sale_opportunity/tox.ini index 53e3ce4cf0..3e0c589b31 100644 --- a/modules/sale_opportunity/tox.ini +++ b/modules/sale_opportunity/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_opportunity --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_opportunity {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_payment/COPYRIGHT b/modules/sale_payment/COPYRIGHT index 07d7611e85..f34e4dd223 100644 --- a/modules/sale_payment/COPYRIGHT +++ b/modules/sale_payment/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (c) 2017 Mark S Hayden. +Copyright (c) 2017 Mark S Hayden Copyright (c) 2017 Coalesco Digital Systemc Inc. -Copyright (c) 2017-2025 Cédric Krier. -Copyright (c) 2017-2025 B2CK. +Copyright (c) 2017-2025 Cédric Krier +Copyright (c) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_payment/MANIFEST.in b/modules/sale_payment/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_payment/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_payment/doc/conf.py b/modules/sale_payment/doc/conf.py index 5d58a47975..a0fbd47c74 100644 --- a/modules/sale_payment/doc/conf.py +++ b/modules/sale_payment/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_payment/doc/requirements-doc.txt b/modules/sale_payment/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_payment/doc/requirements-doc.txt +++ b/modules/sale_payment/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_payment/pyproject.toml b/modules/sale_payment/pyproject.toml new file mode 100644 index 0000000000..281039b82e --- /dev/null +++ b/modules/sale_payment/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_payment' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale payments for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_payment = 'trytond.modules.sale_payment' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-payment/" +changelog = "https://docs.tryton.org/modules-sale-payment/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_payment" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_payment/setup.py b/modules/sale_payment/setup.py deleted file mode 100755 index 19e366cad8..0000000000 --- a/modules/sale_payment/setup.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_payment' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] -for dep in ['account_payment_clearing']: - tests_require.append(get_require_version('trytond_%s' % dep)) - -setup(name=name, - version=version, - description='Tryton module that manage payments on sale', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale payment', - package_dir={'trytond.modules.sale_payment': '.'}, - packages=( - ['trytond.modules.sale_payment'] - + ['trytond.modules.sale_payment.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_payment': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_payment = trytond.modules.sale_payment - """, - ) diff --git a/modules/sale_payment/tox.ini b/modules/sale_payment/tox.ini index 53e3ce4cf0..91e2dcbdfc 100644 --- a/modules/sale_payment/tox.ini +++ b/modules/sale_payment/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_payment --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_payment {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_point/COPYRIGHT b/modules/sale_point/COPYRIGHT index 027b10a997..6c34774f53 100644 --- a/modules/sale_point/COPYRIGHT +++ b/modules/sale_point/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_point/MANIFEST.in b/modules/sale_point/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_point/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_point/doc/conf.py b/modules/sale_point/doc/conf.py index cef46fdca6..e66eb7f566 100644 --- a/modules/sale_point/doc/conf.py +++ b/modules/sale_point/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_point/doc/requirements-doc.txt b/modules/sale_point/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_point/doc/requirements-doc.txt +++ b/modules/sale_point/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_point/pyproject.toml b/modules/sale_point/pyproject.toml new file mode 100644 index 0000000000..a00132690c --- /dev/null +++ b/modules/sale_point/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_point' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Point of sales for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_point = 'trytond.modules.sale_point' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-point/" +changelog = "https://docs.tryton.org/modules-sale-point/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_point" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_point/setup.py b/modules/sale_point/setup.py deleted file mode 100755 index 2a5e64919d..0000000000 --- a/modules/sale_point/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_point' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for Point of Sales', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-sale-point/'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton POS sale', - package_dir={'trytond.modules.sale_point': '.'}, - packages=( - ['trytond.modules.sale_point'] - + ['trytond.modules.sale_point.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_point': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'tests/*.rst', 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_point = trytond.modules.sale_point - """, - ) diff --git a/modules/sale_point/tox.ini b/modules/sale_point/tox.ini index 53e3ce4cf0..80fdea353a 100644 --- a/modules/sale_point/tox.ini +++ b/modules/sale_point/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_point --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_point {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_price_list/COPYRIGHT b/modules/sale_price_list/COPYRIGHT index 3c933baa0c..e8c9eb806d 100644 --- a/modules/sale_price_list/COPYRIGHT +++ b/modules/sale_price_list/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2009-2025 Cédric Krier. -Copyright (C) 2009-2012 Bertrand Chenal. -Copyright (C) 2009-2025 B2CK SPRL. +Copyright (C) 2009-2025 Cédric Krier +Copyright (C) 2009-2012 Bertrand Chenal +Copyright (C) 2009-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_price_list/MANIFEST.in b/modules/sale_price_list/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_price_list/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_price_list/doc/conf.py b/modules/sale_price_list/doc/conf.py index 26b46e8bc6..911ce677c6 100644 --- a/modules/sale_price_list/doc/conf.py +++ b/modules/sale_price_list/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_price_list/doc/requirements-doc.txt b/modules/sale_price_list/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_price_list/doc/requirements-doc.txt +++ b/modules/sale_price_list/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_price_list/pyproject.toml b/modules/sale_price_list/pyproject.toml new file mode 100644 index 0000000000..a5266dd051 --- /dev/null +++ b/modules/sale_price_list/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_price_list' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale price lists for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_price_list = 'trytond.modules.sale_price_list' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-price-list/" +changelog = "https://docs.tryton.org/modules-sale-price-list/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_price_list" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_price_list/setup.py b/modules/sale_price_list/setup.py deleted file mode 100755 index aa6f18c657..0000000000 --- a/modules/sale_price_list/setup.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_price_list' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to add price list on sale', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale price list', - package_dir={'trytond.modules.sale_price_list': '.'}, - packages=( - ['trytond.modules.sale_price_list'] - + ['trytond.modules.sale_price_list.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_price_list': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_price_list = trytond.modules.sale_price_list - """, - ) diff --git a/modules/sale_price_list/tox.ini b/modules/sale_price_list/tox.ini index 53e3ce4cf0..6eb8b1de89 100644 --- a/modules/sale_price_list/tox.ini +++ b/modules/sale_price_list/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_price_list --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_price_list {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_product_customer/MANIFEST.in b/modules/sale_product_customer/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_product_customer/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_product_customer/doc/conf.py b/modules/sale_product_customer/doc/conf.py index eccec73a47..a163c70000 100644 --- a/modules/sale_product_customer/doc/conf.py +++ b/modules/sale_product_customer/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_product_customer/doc/requirements-doc.txt b/modules/sale_product_customer/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_product_customer/doc/requirements-doc.txt +++ b/modules/sale_product_customer/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_product_customer/pyproject.toml b/modules/sale_product_customer/pyproject.toml new file mode 100644 index 0000000000..876cdc9170 --- /dev/null +++ b/modules/sale_product_customer/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_product_customer' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Customer products for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_product_customer = 'trytond.modules.sale_product_customer' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-product-customer/" +changelog = "https://docs.tryton.org/modules-sale-product-customer/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_product_customer" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_product_customer/setup.py b/modules/sale_product_customer/setup.py deleted file mode 100755 index 4f4c10dda6..0000000000 --- a/modules/sale_product_customer/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_product_customer' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale_amendment'), - get_require_version('trytond_sale_blanket_agreement'), - ] - -setup(name=name, - version=version, - description='Tryton module to manage customer product on sale', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale product customer', - package_dir={'trytond.modules.sale_product_customer': '.'}, - packages=( - ['trytond.modules.sale_product_customer'] - + ['trytond.modules.sale_product_customer.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_product_customer': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_product_customer = trytond.modules.sale_product_customer - """, - ) diff --git a/modules/sale_product_customer/tox.ini b/modules/sale_product_customer/tox.ini index 53e3ce4cf0..8d791580b0 100644 --- a/modules/sale_product_customer/tox.ini +++ b/modules/sale_product_customer/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_product_customer --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_product_customer {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_product_quantity/COPYRIGHT b/modules/sale_product_quantity/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/sale_product_quantity/COPYRIGHT +++ b/modules/sale_product_quantity/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_product_quantity/MANIFEST.in b/modules/sale_product_quantity/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_product_quantity/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_product_quantity/doc/conf.py b/modules/sale_product_quantity/doc/conf.py index 341c907525..8bb11856dd 100644 --- a/modules/sale_product_quantity/doc/conf.py +++ b/modules/sale_product_quantity/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_product_quantity/doc/requirements-doc.txt b/modules/sale_product_quantity/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_product_quantity/doc/requirements-doc.txt +++ b/modules/sale_product_quantity/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_product_quantity/pyproject.toml b/modules/sale_product_quantity/pyproject.toml new file mode 100644 index 0000000000..28219888cb --- /dev/null +++ b/modules/sale_product_quantity/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_product_quantity' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Quantity constraints on sales for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_product_quantity = 'trytond.modules.sale_product_quantity' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-product-quantity/" +changelog = "https://docs.tryton.org/modules-sale-product-quantity/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_product_quantity" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_product_quantity/setup.py b/modules/sale_product_quantity/setup.py deleted file mode 100755 index c1ec7f7302..0000000000 --- a/modules/sale_product_quantity/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_product_quantity' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale_point'), - ] - -setup(name=name, - version=version, - description='Tryton module to add quantity constraints on sale line', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-sale-product-quantity'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale product quantity', - package_dir={'trytond.modules.sale_product_quantity': '.'}, - packages=( - ['trytond.modules.sale_product_quantity'] - + ['trytond.modules.sale_product_quantity.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_product_quantity': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_product_quantity = trytond.modules.sale_product_quantity - """, # noqa: E501 - ) diff --git a/modules/sale_product_quantity/tox.ini b/modules/sale_product_quantity/tox.ini index 53e3ce4cf0..09dc24ef7f 100644 --- a/modules/sale_product_quantity/tox.ini +++ b/modules/sale_product_quantity/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_product_quantity --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_product_quantity {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_product_recommendation/COPYRIGHT b/modules/sale_product_recommendation/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/sale_product_recommendation/COPYRIGHT +++ b/modules/sale_product_recommendation/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_product_recommendation/MANIFEST.in b/modules/sale_product_recommendation/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_product_recommendation/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_product_recommendation/doc/conf.py b/modules/sale_product_recommendation/doc/conf.py index a620d4de55..2242192f72 100644 --- a/modules/sale_product_recommendation/doc/conf.py +++ b/modules/sale_product_recommendation/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_product_recommendation/doc/requirements-doc.txt b/modules/sale_product_recommendation/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_product_recommendation/doc/requirements-doc.txt +++ b/modules/sale_product_recommendation/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_product_recommendation/pyproject.toml b/modules/sale_product_recommendation/pyproject.toml new file mode 100644 index 0000000000..d06a283bcf --- /dev/null +++ b/modules/sale_product_recommendation/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_product_recommendation' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Product recommendations for sales in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_product_recommendation = 'trytond.modules.sale_product_recommendation' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-product-recommendation/" +changelog = "https://docs.tryton.org/modules-sale-product-recommendation/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_product_recommendation" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/sale_product_recommendation/setup.py b/modules/sale_product_recommendation/setup.py deleted file mode 100755 index c3017e4ae5..0000000000 --- a/modules/sale_product_recommendation/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_product_recommendation' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('trytond_sale_point')] - -setup(name=name, - version=version, - description='Tryton module for product recommendation', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-sale-product-recommendation'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale product recommendation', - package_dir={'trytond.modules.sale_product_recommendation': '.'}, - packages=( - ['trytond.modules.sale_product_recommendation'] - + ['trytond.modules.sale_product_recommendation.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_product_recommendation': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_product_recommendation = trytond.modules.sale_product_recommendation - """, # noqa: E501 - ) diff --git a/modules/sale_product_recommendation/tox.ini b/modules/sale_product_recommendation/tox.ini index 53e3ce4cf0..4fe5b5a893 100644 --- a/modules/sale_product_recommendation/tox.ini +++ b/modules/sale_product_recommendation/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_product_recommendation --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_product_recommendation {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_product_recommendation_association_rule/COPYRIGHT b/modules/sale_product_recommendation_association_rule/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/sale_product_recommendation_association_rule/COPYRIGHT +++ b/modules/sale_product_recommendation_association_rule/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_product_recommendation_association_rule/MANIFEST.in b/modules/sale_product_recommendation_association_rule/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_product_recommendation_association_rule/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_product_recommendation_association_rule/doc/conf.py b/modules/sale_product_recommendation_association_rule/doc/conf.py index d2299d3a06..3b55403bdd 100644 --- a/modules/sale_product_recommendation_association_rule/doc/conf.py +++ b/modules/sale_product_recommendation_association_rule/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_product_recommendation_association_rule/doc/requirements-doc.txt b/modules/sale_product_recommendation_association_rule/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_product_recommendation_association_rule/doc/requirements-doc.txt +++ b/modules/sale_product_recommendation_association_rule/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_product_recommendation_association_rule/pyproject.toml b/modules/sale_product_recommendation_association_rule/pyproject.toml new file mode 100644 index 0000000000..59ab67c330 --- /dev/null +++ b/modules/sale_product_recommendation_association_rule/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_product_recommendation_association_rule' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Association rules of recommendations for sales in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_product_recommendation_association_rule = 'trytond.modules.sale_product_recommendation_association_rule' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-product-recommendation-association-rule/" +changelog = "https://docs.tryton.org/modules-sale-product-recommendation-association-rule/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_product_recommendation_association_rule" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['efficient-apriori'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_product_recommendation_association_rule/setup.py b/modules/sale_product_recommendation_association_rule/setup.py deleted file mode 100755 index a62a74d4e9..0000000000 --- a/modules/sale_product_recommendation_association_rule/setup.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_product_recommendation_association_rule' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['efficient-apriori'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale_point'), - ] - -setup(name=name, - version=version, - description='Tryton module to learn association rule for recommendation', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-sale-product-recommendation-association-rule'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale product recommendation association rule learning', - package_dir={ - 'trytond.modules.sale_product_recommendation_association_rule': '.', - }, - packages=( - ['trytond.modules.sale_product_recommendation_association_rule'] - + ['trytond.modules.' - 'sale_product_recommendation_association_rule.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.' - 'sale_product_recommendation_association_rule': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_product_recommendation_association_rule = trytond.modules.sale_product_recommendation_association_rule - """, # noqa: E501 - ) diff --git a/modules/sale_product_recommendation_association_rule/tox.ini b/modules/sale_product_recommendation_association_rule/tox.ini index 53e3ce4cf0..7f657e1cb4 100644 --- a/modules/sale_product_recommendation_association_rule/tox.ini +++ b/modules/sale_product_recommendation_association_rule/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_product_recommendation_association_rule --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_product_recommendation_association_rule {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_promotion/COPYRIGHT b/modules/sale_promotion/COPYRIGHT index 027b10a997..6c34774f53 100644 --- a/modules/sale_promotion/COPYRIGHT +++ b/modules/sale_promotion/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_promotion/MANIFEST.in b/modules/sale_promotion/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_promotion/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_promotion/doc/conf.py b/modules/sale_promotion/doc/conf.py index 86e2d4c025..90e372102a 100644 --- a/modules/sale_promotion/doc/conf.py +++ b/modules/sale_promotion/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_promotion/doc/requirements-doc.txt b/modules/sale_promotion/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_promotion/doc/requirements-doc.txt +++ b/modules/sale_promotion/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_promotion/pyproject.toml b/modules/sale_promotion/pyproject.toml new file mode 100644 index 0000000000..9dd489fe79 --- /dev/null +++ b/modules/sale_promotion/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_promotion' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale promotions for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_promotion = 'trytond.modules.sale_promotion' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-promotion/" +changelog = "https://docs.tryton.org/modules-sale-promotion/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_promotion" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql', + 'simpleeval', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_promotion/setup.py b/modules/sale_promotion/setup.py deleted file mode 100755 index 2e938fb73f..0000000000 --- a/modules/sale_promotion/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_promotion' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['simpleeval', 'python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale_point'), - ] - -setup(name=name, - version=version, - description='Tryton module for sale promotion', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale promotion', - package_dir={'trytond.modules.sale_promotion': '.'}, - packages=( - ['trytond.modules.sale_promotion'] - + ['trytond.modules.sale_promotion.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_promotion': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_promotion = trytond.modules.sale_promotion - """, - ) diff --git a/modules/sale_promotion/tox.ini b/modules/sale_promotion/tox.ini index 53e3ce4cf0..b4c553240b 100644 --- a/modules/sale_promotion/tox.ini +++ b/modules/sale_promotion/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_promotion --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_promotion {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_promotion_coupon/COPYRIGHT b/modules/sale_promotion_coupon/COPYRIGHT index ae52665ab2..6f3a8ebb90 100644 --- a/modules/sale_promotion_coupon/COPYRIGHT +++ b/modules/sale_promotion_coupon/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_promotion_coupon/MANIFEST.in b/modules/sale_promotion_coupon/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_promotion_coupon/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_promotion_coupon/doc/conf.py b/modules/sale_promotion_coupon/doc/conf.py index 089b135bf1..d9af9e9724 100644 --- a/modules/sale_promotion_coupon/doc/conf.py +++ b/modules/sale_promotion_coupon/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_promotion_coupon/doc/requirements-doc.txt b/modules/sale_promotion_coupon/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_promotion_coupon/doc/requirements-doc.txt +++ b/modules/sale_promotion_coupon/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_promotion_coupon/pyproject.toml b/modules/sale_promotion_coupon/pyproject.toml new file mode 100644 index 0000000000..69b10f9fa7 --- /dev/null +++ b/modules/sale_promotion_coupon/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_promotion_coupon' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale promotion coupons for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_promotion_coupon = 'trytond.modules.sale_promotion_coupon' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-promotion-coupon/" +changelog = "https://docs.tryton.org/modules-sale-promotion-coupon/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_promotion_coupon" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_promotion_coupon/setup.py b/modules/sale_promotion_coupon/setup.py deleted file mode 100755 index 93be791cbe..0000000000 --- a/modules/sale_promotion_coupon/setup.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_promotion_coupon' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for sale promotion coupon', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale promotion coupon', - package_dir={'trytond.modules.sale_promotion_coupon': '.'}, - packages=( - ['trytond.modules.sale_promotion_coupon'] - + ['trytond.modules.sale_promotion_coupon.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_promotion_coupon': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_promotion_coupon = trytond.modules.sale_promotion_coupon - """, - ) diff --git a/modules/sale_promotion_coupon/tox.ini b/modules/sale_promotion_coupon/tox.ini index 53e3ce4cf0..8b3fefb6fa 100644 --- a/modules/sale_promotion_coupon/tox.ini +++ b/modules/sale_promotion_coupon/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_promotion_coupon --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_promotion_coupon {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_promotion_coupon_payment/COPYRIGHT b/modules/sale_promotion_coupon_payment/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/sale_promotion_coupon_payment/COPYRIGHT +++ b/modules/sale_promotion_coupon_payment/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_promotion_coupon_payment/MANIFEST.in b/modules/sale_promotion_coupon_payment/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_promotion_coupon_payment/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_promotion_coupon_payment/doc/conf.py b/modules/sale_promotion_coupon_payment/doc/conf.py index 9c4739a673..7ef4df590e 100644 --- a/modules/sale_promotion_coupon_payment/doc/conf.py +++ b/modules/sale_promotion_coupon_payment/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_promotion_coupon_payment/doc/requirements-doc.txt b/modules/sale_promotion_coupon_payment/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_promotion_coupon_payment/doc/requirements-doc.txt +++ b/modules/sale_promotion_coupon_payment/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_promotion_coupon_payment/pyproject.toml b/modules/sale_promotion_coupon_payment/pyproject.toml new file mode 100644 index 0000000000..6ee0906816 --- /dev/null +++ b/modules/sale_promotion_coupon_payment/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_promotion_coupon_payment' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Count sale promotion coupons using payments in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_promotion_coupon_payment = 'trytond.modules.sale_promotion_coupon_payment' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-promotion-coupon-payment/" +changelog = "https://docs.tryton.org/modules-sale-promotion-coupon-payment/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_promotion_coupon_payment" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/sale_promotion_coupon_payment/setup.py b/modules/sale_promotion_coupon_payment/setup.py deleted file mode 100755 index e8b6fb76cc..0000000000 --- a/modules/sale_promotion_coupon_payment/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_promotion_coupon_payment' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to link payment with coupon', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-sale-promotion-coupon-payment'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale promotion coupon payment', - package_dir={'trytond.modules.sale_promotion_coupon_payment': '.'}, - packages=( - ['trytond.modules.sale_promotion_coupon_payment'] - + ['trytond.modules.sale_promotion_coupon_payment.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_promotion_coupon_payment': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_promotion_coupon_payment = trytond.modules.sale_promotion_coupon_payment - """, # noqa: E501 - ) diff --git a/modules/sale_promotion_coupon_payment/tox.ini b/modules/sale_promotion_coupon_payment/tox.ini index 53e3ce4cf0..f753076fe0 100644 --- a/modules/sale_promotion_coupon_payment/tox.ini +++ b/modules/sale_promotion_coupon_payment/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_promotion_coupon_payment --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_promotion_coupon_payment {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_rental/.readthedocs.yaml b/modules/sale_rental/.readthedocs.yaml deleted file mode 100644 index 72203f28f5..0000000000 --- a/modules/sale_rental/.readthedocs.yaml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 -build: - os: ubuntu-22.04 - tools: - python: "3" -python: - install: - - requirements: modules/sale_rental/doc/requirements-doc.txt -sphinx: - configuration: modules/sale_rental/doc/conf.py diff --git a/modules/sale_rental/COPYRIGHT b/modules/sale_rental/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/sale_rental/COPYRIGHT +++ b/modules/sale_rental/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_rental/MANIFEST.in b/modules/sale_rental/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_rental/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_rental/doc/conf.py b/modules/sale_rental/doc/conf.py index bc9eb67570..8243bd47e9 100644 --- a/modules/sale_rental/doc/conf.py +++ b/modules/sale_rental/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_rental/doc/requirements-doc.txt b/modules/sale_rental/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_rental/doc/requirements-doc.txt +++ b/modules/sale_rental/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_rental/pyproject.toml b/modules/sale_rental/pyproject.toml new file mode 100644 index 0000000000..c12644a782 --- /dev/null +++ b/modules/sale_rental/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_rental' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale rentals for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale", "rental"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_rental = 'trytond.modules.sale_rental' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-rental/" +changelog = "https://docs.tryton.org/modules-sale-rental/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_rental" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_rental/setup.py b/modules/sale_rental/setup.py deleted file mode 100755 index 2d5e807f9d..0000000000 --- a/modules/sale_rental/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_rental' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_asset'), - ] - -setup(name=name, - version=version, - description='Tryton module for sale rental', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/projects/modules-sale-rental'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale rental', - package_dir={'trytond.modules.sale_rental': '.'}, - packages=( - ['trytond.modules.sale_rental'] - + ['trytond.modules.sale_rental.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_rental': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_rental = trytond.modules.sale_rental - """, # noqa: E501 - ) diff --git a/modules/sale_rental/tox.ini b/modules/sale_rental/tox.ini index 53e3ce4cf0..2e11dce703 100644 --- a/modules/sale_rental/tox.ini +++ b/modules/sale_rental/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_rental --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_rental {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_rental_progress_invoice/COPYRIGHT b/modules/sale_rental_progress_invoice/COPYRIGHT index 643c463ffe..16456926b3 100644 --- a/modules/sale_rental_progress_invoice/COPYRIGHT +++ b/modules/sale_rental_progress_invoice/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2024-2025 Cédric Krier +Copyright (C) 2024-2025 Cédric Krier +Copyright (C) 2024-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_rental_progress_invoice/MANIFEST.in b/modules/sale_rental_progress_invoice/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_rental_progress_invoice/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_rental_progress_invoice/doc/conf.py b/modules/sale_rental_progress_invoice/doc/conf.py index 33213d1c55..c11bece786 100644 --- a/modules/sale_rental_progress_invoice/doc/conf.py +++ b/modules/sale_rental_progress_invoice/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_rental_progress_invoice/doc/requirements-doc.txt b/modules/sale_rental_progress_invoice/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_rental_progress_invoice/doc/requirements-doc.txt +++ b/modules/sale_rental_progress_invoice/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_rental_progress_invoice/pyproject.toml b/modules/sale_rental_progress_invoice/pyproject.toml new file mode 100644 index 0000000000..be6ad22182 --- /dev/null +++ b/modules/sale_rental_progress_invoice/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_rental_progress_invoice' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Progress invoices for sale rental in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale", "rental"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_rental_progress_invoice = 'trytond.modules.sale_rental_progress_invoice' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-rental-progress-invoice/" +changelog = "https://docs.tryton.org/modules-sale-rental-progress-invoice/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_rental_progress_invoice" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_rental_progress_invoice/setup.py b/modules/sale_rental_progress_invoice/setup.py deleted file mode 100755 index 322fe4da61..0000000000 --- a/modules/sale_rental_progress_invoice/setup.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_rental_progress_invoice' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_asset'), - ] - -setup(name=name, - version=version, - description='Tryton module to create progress invoice for sale rental', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-sale-rental-progress-invoice'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale rental progress invoice', - package_dir={'trytond.modules.sale_rental_progress_invoice': '.'}, - packages=( - ['trytond.modules.sale_rental_progress_invoice'] - + ['trytond.modules.sale_rental_progress_invoice.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_rental_progress_invoice': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_rental_progress_invoice = trytond.modules.sale_rental_progress_invoice - """, # noqa: E501 - ) diff --git a/modules/sale_rental_progress_invoice/tox.ini b/modules/sale_rental_progress_invoice/tox.ini index 53e3ce4cf0..d87e94f976 100644 --- a/modules/sale_rental_progress_invoice/tox.ini +++ b/modules/sale_rental_progress_invoice/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_rental_progress_invoice --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_rental_progress_invoice {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_secondary_unit/COPYRIGHT b/modules/sale_secondary_unit/COPYRIGHT index e42fe356fc..e7dd2b7778 100644 --- a/modules/sale_secondary_unit/COPYRIGHT +++ b/modules/sale_secondary_unit/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2019-2025 Cédric Krier -Copyright (C) 2019-2025 B2CK +Copyright (C) 2019-2025 Cédric Krier +Copyright (C) 2019-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_secondary_unit/MANIFEST.in b/modules/sale_secondary_unit/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_secondary_unit/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_secondary_unit/doc/conf.py b/modules/sale_secondary_unit/doc/conf.py index 02ec64eea2..55a39063b4 100644 --- a/modules/sale_secondary_unit/doc/conf.py +++ b/modules/sale_secondary_unit/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_secondary_unit/doc/requirements-doc.txt b/modules/sale_secondary_unit/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_secondary_unit/doc/requirements-doc.txt +++ b/modules/sale_secondary_unit/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_secondary_unit/pyproject.toml b/modules/sale_secondary_unit/pyproject.toml new file mode 100644 index 0000000000..c3534e1b12 --- /dev/null +++ b/modules/sale_secondary_unit/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_secondary_unit' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Secondary unit for sales in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_secondary_unit = 'trytond.modules.sale_secondary_unit' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-secondary-unit/" +changelog = "https://docs.tryton.org/modules-sale-secondary-unit/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_secondary_unit" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_secondary_unit/setup.py b/modules/sale_secondary_unit/setup.py deleted file mode 100755 index d7bf2886d1..0000000000 --- a/modules/sale_secondary_unit/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_secondary_unit' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_account_invoice_secondary_unit'), - get_require_version('trytond_sale_amendment'), - get_require_version('trytond_sale_blanket_agreement'), - get_require_version('trytond_stock_secondary_unit'), - get_require_version('trytond_sale_product_customer')] - -setup(name=name, - version=version, - description='Tryton module to add a secondary unit on sale line', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale secondary unit', - package_dir={'trytond.modules.sale_secondary_unit': '.'}, - packages=( - ['trytond.modules.sale_secondary_unit'] - + ['trytond.modules.sale_secondary_unit.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_secondary_unit': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_secondary_unit = trytond.modules.sale_secondary_unit - """, - ) diff --git a/modules/sale_secondary_unit/tox.ini b/modules/sale_secondary_unit/tox.ini index 53e3ce4cf0..7bccd2933a 100644 --- a/modules/sale_secondary_unit/tox.ini +++ b/modules/sale_secondary_unit/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_secondary_unit --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_secondary_unit {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_shipment_cost/COPYRIGHT b/modules/sale_shipment_cost/COPYRIGHT index 00b70dfe19..388749897b 100644 --- a/modules/sale_shipment_cost/COPYRIGHT +++ b/modules/sale_shipment_cost/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2013 Bertrand Chenal. -Copyright (C) 2011-2025 Nicolas Évrard. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2013 Bertrand Chenal +Copyright (C) 2011-2025 Nicolas Évrard +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_shipment_cost/MANIFEST.in b/modules/sale_shipment_cost/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_shipment_cost/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_shipment_cost/doc/conf.py b/modules/sale_shipment_cost/doc/conf.py index 0204769f9f..9ec781b57f 100644 --- a/modules/sale_shipment_cost/doc/conf.py +++ b/modules/sale_shipment_cost/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_shipment_cost/doc/requirements-doc.txt b/modules/sale_shipment_cost/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_shipment_cost/doc/requirements-doc.txt +++ b/modules/sale_shipment_cost/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_shipment_cost/pyproject.toml b/modules/sale_shipment_cost/pyproject.toml new file mode 100644 index 0000000000..2142819fc8 --- /dev/null +++ b/modules/sale_shipment_cost/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_shipment_cost' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shipment cost for sales in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_shipment_cost = 'trytond.modules.sale_shipment_cost' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-shipment-cost/" +changelog = "https://docs.tryton.org/modules-sale-shipment-cost/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_shipment_cost" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_shipment_cost/setup.py b/modules/sale_shipment_cost/setup.py deleted file mode 100755 index 0a736ecf14..0000000000 --- a/modules/sale_shipment_cost/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_shipment_cost' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - ] -for dep in [ - 'account', 'party', 'stock', 'sale_promotion', - 'sale_shipment_grouping']: - tests_require.append(get_require_version('trytond_%s' % dep)) - -setup(name=name, - version=version, - description='Tryton module for sale shipment cost', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale shipment cost', - package_dir={'trytond.modules.sale_shipment_cost': '.'}, - packages=( - ['trytond.modules.sale_shipment_cost'] - + ['trytond.modules.sale_shipment_cost.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_shipment_cost': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_shipment_cost = trytond.modules.sale_shipment_cost - """, - ) diff --git a/modules/sale_shipment_cost/tox.ini b/modules/sale_shipment_cost/tox.ini index 53e3ce4cf0..8c78d422bf 100644 --- a/modules/sale_shipment_cost/tox.ini +++ b/modules/sale_shipment_cost/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_shipment_cost --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_shipment_cost {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_shipment_grouping/COPYRIGHT b/modules/sale_shipment_grouping/COPYRIGHT index cd878e5e6f..d62f240e5b 100644 --- a/modules/sale_shipment_grouping/COPYRIGHT +++ b/modules/sale_shipment_grouping/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2014-2025 Nicolas Évrard. -Copyright (C) 2014-2025 B2CK SPRL. +Copyright (C) 2014-2025 Nicolas Évrard +Copyright (C) 2014-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_shipment_grouping/MANIFEST.in b/modules/sale_shipment_grouping/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_shipment_grouping/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_shipment_grouping/doc/conf.py b/modules/sale_shipment_grouping/doc/conf.py index c222234319..4d6277b020 100644 --- a/modules/sale_shipment_grouping/doc/conf.py +++ b/modules/sale_shipment_grouping/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_shipment_grouping/doc/requirements-doc.txt b/modules/sale_shipment_grouping/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_shipment_grouping/doc/requirements-doc.txt +++ b/modules/sale_shipment_grouping/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_shipment_grouping/pyproject.toml b/modules/sale_shipment_grouping/pyproject.toml new file mode 100644 index 0000000000..4d8ee37b17 --- /dev/null +++ b/modules/sale_shipment_grouping/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_shipment_grouping' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Group shipments from sales in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale", "shipment"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_shipment_grouping = 'trytond.modules.sale_shipment_grouping' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-shipment-grouping/" +changelog = "https://docs.tryton.org/modules-sale-shipment-grouping/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_shipment_grouping" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_shipment_grouping/setup.py b/modules/sale_shipment_grouping/setup.py deleted file mode 100755 index ffaab26d09..0000000000 --- a/modules/sale_shipment_grouping/setup.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_shipment_grouping' - -download_url = 'http://dowloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to group sale stock moves', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale shipment grouping', - package_dir={'trytond.modules.sale_shipment_grouping': '.'}, - packages=( - ['trytond.modules.sale_shipment_grouping'] - + ['trytond.modules.sale_shipment_grouping.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_shipment_grouping': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_shipment_grouping = trytond.modules.sale_shipment_grouping - """, - ) diff --git a/modules/sale_shipment_grouping/tox.ini b/modules/sale_shipment_grouping/tox.ini index 53e3ce4cf0..3f3c859726 100644 --- a/modules/sale_shipment_grouping/tox.ini +++ b/modules/sale_shipment_grouping/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_shipment_grouping --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_shipment_grouping {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_shipment_tolerance/COPYRIGHT b/modules/sale_shipment_tolerance/COPYRIGHT index 9512eceaed..6f3a8ebb90 100644 --- a/modules/sale_shipment_tolerance/COPYRIGHT +++ b/modules/sale_shipment_tolerance/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2017-2025 Cédric Krier -Copyright (C) 2017-2025 B2CK +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_shipment_tolerance/MANIFEST.in b/modules/sale_shipment_tolerance/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_shipment_tolerance/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_shipment_tolerance/doc/conf.py b/modules/sale_shipment_tolerance/doc/conf.py index 64ebe96575..d1a91eb344 100644 --- a/modules/sale_shipment_tolerance/doc/conf.py +++ b/modules/sale_shipment_tolerance/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_shipment_tolerance/doc/requirements-doc.txt b/modules/sale_shipment_tolerance/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_shipment_tolerance/doc/requirements-doc.txt +++ b/modules/sale_shipment_tolerance/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_shipment_tolerance/pyproject.toml b/modules/sale_shipment_tolerance/pyproject.toml new file mode 100644 index 0000000000..7ecbfef6d9 --- /dev/null +++ b/modules/sale_shipment_tolerance/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_shipment_tolerance' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shipment tolerance for sales in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale", "shipment"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_shipment_tolerance = 'trytond.modules.sale_shipment_tolerance' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-shipment-tolerance/" +changelog = "https://docs.tryton.org/modules-sale-shipment-tolerance/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_shipment_tolerance" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_shipment_tolerance/setup.py b/modules/sale_shipment_tolerance/setup.py deleted file mode 100755 index c02476795e..0000000000 --- a/modules/sale_shipment_tolerance/setup.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_shipment_tolerance' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to define tolerance for sale shipment', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale shipment tolerance back-order', - package_dir={'trytond.modules.sale_shipment_tolerance': '.'}, - packages=( - ['trytond.modules.sale_shipment_tolerance'] - + ['trytond.modules.sale_shipment_tolerance.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_shipment_tolerance': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_shipment_tolerance = trytond.modules.sale_shipment_tolerance - """, - ) diff --git a/modules/sale_shipment_tolerance/tox.ini b/modules/sale_shipment_tolerance/tox.ini index 53e3ce4cf0..7dfe88f4cd 100644 --- a/modules/sale_shipment_tolerance/tox.ini +++ b/modules/sale_shipment_tolerance/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_shipment_tolerance --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_shipment_tolerance {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_stock_quantity/COPYRIGHT b/modules/sale_stock_quantity/COPYRIGHT index 027b10a997..6c34774f53 100644 --- a/modules/sale_stock_quantity/COPYRIGHT +++ b/modules/sale_stock_quantity/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2015-2025 Cédric Krier. -Copyright (C) 2015-2025 B2CK SPRL. +Copyright (C) 2015-2025 Cédric Krier +Copyright (C) 2015-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_stock_quantity/MANIFEST.in b/modules/sale_stock_quantity/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_stock_quantity/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_stock_quantity/doc/conf.py b/modules/sale_stock_quantity/doc/conf.py index f61b402089..330ce7ebe7 100644 --- a/modules/sale_stock_quantity/doc/conf.py +++ b/modules/sale_stock_quantity/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_stock_quantity/doc/requirements-doc.txt b/modules/sale_stock_quantity/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_stock_quantity/doc/requirements-doc.txt +++ b/modules/sale_stock_quantity/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_stock_quantity/pyproject.toml b/modules/sale_stock_quantity/pyproject.toml new file mode 100644 index 0000000000..65110c2bb8 --- /dev/null +++ b/modules/sale_stock_quantity/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_stock_quantity' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Check stock for sales in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_stock_quantity = 'trytond.modules.sale_stock_quantity' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-stock-quantity/" +changelog = "https://docs.tryton.org/modules-sale-stock-quantity/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_stock_quantity" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_stock_quantity/setup.py b/modules/sale_stock_quantity/setup.py deleted file mode 100755 index e5a4db857e..0000000000 --- a/modules/sale_stock_quantity/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_stock_quantity' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_stock_supply'), - ] - -setup(name=name, - version=version, - description='Tryton module to add stock warning on sale', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale stock', - package_dir={'trytond.modules.sale_stock_quantity': '.'}, - packages=( - ['trytond.modules.sale_stock_quantity'] - + ['trytond.modules.sale_stock_quantity.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_stock_quantity': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst', - '*.fodt']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_stock_quantity = trytond.modules.sale_stock_quantity - """, - ) diff --git a/modules/sale_stock_quantity/tox.ini b/modules/sale_stock_quantity/tox.ini index 53e3ce4cf0..19712ac8a9 100644 --- a/modules/sale_stock_quantity/tox.ini +++ b/modules/sale_stock_quantity/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_stock_quantity --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_stock_quantity {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_subscription/COPYRIGHT b/modules/sale_subscription/COPYRIGHT index a7989f4d90..20cd6e00b2 100644 --- a/modules/sale_subscription/COPYRIGHT +++ b/modules/sale_subscription/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2016-2025 Cédric Krier -Copyright (C) 2016-2025 B2CK SPRL. +Copyright (C) 2016-2025 Cédric Krier +Copyright (C) 2016-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_subscription/MANIFEST.in b/modules/sale_subscription/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_subscription/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_subscription/doc/conf.py b/modules/sale_subscription/doc/conf.py index fe76ea8482..5ddb624492 100644 --- a/modules/sale_subscription/doc/conf.py +++ b/modules/sale_subscription/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_subscription/doc/requirements-doc.txt b/modules/sale_subscription/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_subscription/doc/requirements-doc.txt +++ b/modules/sale_subscription/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_subscription/pyproject.toml b/modules/sale_subscription/pyproject.toml new file mode 100644 index 0000000000..41b737bd91 --- /dev/null +++ b/modules/sale_subscription/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_subscription' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Sale subscriptions for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale", "subscription"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_subscription = 'trytond.modules.sale_subscription' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-subscription/" +changelog = "https://docs.tryton.org/modules-sale-subscription/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_subscription" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-dateutil'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_subscription/setup.py b/modules/sale_subscription/setup.py deleted file mode 100755 index 68a7f16130..0000000000 --- a/modules/sale_subscription/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_subscription' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-dateutil'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for subscription', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale subscription', - package_dir={'trytond.modules.sale_subscription': '.'}, - packages=( - ['trytond.modules.sale_subscription'] - + ['trytond.modules.sale_subscription.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_subscription': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_subscription = trytond.modules.sale_subscription - """, - ) diff --git a/modules/sale_subscription/tox.ini b/modules/sale_subscription/tox.ini index 53e3ce4cf0..57822c2664 100644 --- a/modules/sale_subscription/tox.ini +++ b/modules/sale_subscription/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_subscription --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_subscription {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_subscription_asset/COPYRIGHT b/modules/sale_subscription_asset/COPYRIGHT index bba9b6acba..d89e938da0 100644 --- a/modules/sale_subscription_asset/COPYRIGHT +++ b/modules/sale_subscription_asset/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2018-2025 B2CK -Copyright (C) 2018-2025 Cédric Krier -Copyright (C) 2018-2025 Nicolas Évrard +Copyright (C) 2018-2025 B2CK SRL +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 Nicolas Évrard This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_subscription_asset/MANIFEST.in b/modules/sale_subscription_asset/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_subscription_asset/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_subscription_asset/doc/conf.py b/modules/sale_subscription_asset/doc/conf.py index 2446ff0c97..949eb6f1cb 100644 --- a/modules/sale_subscription_asset/doc/conf.py +++ b/modules/sale_subscription_asset/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_subscription_asset/doc/requirements-doc.txt b/modules/sale_subscription_asset/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_subscription_asset/doc/requirements-doc.txt +++ b/modules/sale_subscription_asset/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_subscription_asset/pyproject.toml b/modules/sale_subscription_asset/pyproject.toml new file mode 100644 index 0000000000..8f4ce9a19c --- /dev/null +++ b/modules/sale_subscription_asset/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_subscription_asset' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Assets for sale subscriptions in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale", "subscription"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_subscription_asset = 'trytond.modules.sale_subscription_asset' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-subscription-asset/" +changelog = "https://docs.tryton.org/modules-sale-subscription-asset/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_subscription_asset" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_subscription_asset/setup.py b/modules/sale_subscription_asset/setup.py deleted file mode 100755 index 5081079a01..0000000000 --- a/modules/sale_subscription_asset/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_subscription_asset' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='A module to handle asset in the sale subscriptions', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='', - package_dir={'trytond.modules.sale_subscription_asset': '.'}, - packages=( - ['trytond.modules.sale_subscription_asset'] - + ['trytond.modules.sale_subscription_asset.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_subscription_asset': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_subscription_asset = trytond.modules.sale_subscription_asset - """, - ) diff --git a/modules/sale_subscription_asset/tox.ini b/modules/sale_subscription_asset/tox.ini index 53e3ce4cf0..b1badfaf03 100644 --- a/modules/sale_subscription_asset/tox.ini +++ b/modules/sale_subscription_asset/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_subscription_asset --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_subscription_asset {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_supply/COPYRIGHT b/modules/sale_supply/COPYRIGHT index d61e4ef396..10c8c55375 100644 --- a/modules/sale_supply/COPYRIGHT +++ b/modules/sale_supply/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_supply/MANIFEST.in b/modules/sale_supply/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_supply/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_supply/doc/conf.py b/modules/sale_supply/doc/conf.py index ebd5154b14..e7ab246dfd 100644 --- a/modules/sale_supply/doc/conf.py +++ b/modules/sale_supply/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_supply/doc/requirements-doc.txt b/modules/sale_supply/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_supply/doc/requirements-doc.txt +++ b/modules/sale_supply/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_supply/pyproject.toml b/modules/sale_supply/pyproject.toml new file mode 100644 index 0000000000..a4b3b15628 --- /dev/null +++ b/modules/sale_supply/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_supply' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Supply sales in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_supply = 'trytond.modules.sale_supply' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-supply/" +changelog = "https://docs.tryton.org/modules-sale-supply/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_supply" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_supply/setup.py b/modules/sale_supply/setup.py deleted file mode 100755 index 7f4a67ec5a..0000000000 --- a/modules/sale_supply/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_supply' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_stock_supply'), - ] - -setup(name=name, - version=version, - description='Tryton module for sale supply', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale supply', - package_dir={'trytond.modules.sale_supply': '.'}, - packages=( - ['trytond.modules.sale_supply'] - + ['trytond.modules.sale_supply.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_supply': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_supply = trytond.modules.sale_supply - """, - ) diff --git a/modules/sale_supply/tox.ini b/modules/sale_supply/tox.ini index 53e3ce4cf0..f032c83a63 100644 --- a/modules/sale_supply/tox.ini +++ b/modules/sale_supply/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_supply --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_supply {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_supply_drop_shipment/COPYRIGHT b/modules/sale_supply_drop_shipment/COPYRIGHT index d61e4ef396..10c8c55375 100644 --- a/modules/sale_supply_drop_shipment/COPYRIGHT +++ b/modules/sale_supply_drop_shipment/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_supply_drop_shipment/MANIFEST.in b/modules/sale_supply_drop_shipment/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_supply_drop_shipment/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_supply_drop_shipment/doc/conf.py b/modules/sale_supply_drop_shipment/doc/conf.py index af95652568..304491260e 100644 --- a/modules/sale_supply_drop_shipment/doc/conf.py +++ b/modules/sale_supply_drop_shipment/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_supply_drop_shipment/doc/requirements-doc.txt b/modules/sale_supply_drop_shipment/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_supply_drop_shipment/doc/requirements-doc.txt +++ b/modules/sale_supply_drop_shipment/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_supply_drop_shipment/pyproject.toml b/modules/sale_supply_drop_shipment/pyproject.toml new file mode 100644 index 0000000000..35fff90170 --- /dev/null +++ b/modules/sale_supply_drop_shipment/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_supply_drop_shipment' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Drop shipments for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = [] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_supply_drop_shipment = 'trytond.modules.sale_supply_drop_shipment' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-supply-drop-shipment/" +changelog = "https://docs.tryton.org/modules-sale-supply-drop-shipment/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_supply_drop_shipment" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_supply_drop_shipment/setup.py b/modules/sale_supply_drop_shipment/setup.py deleted file mode 100755 index 1a1b2d431e..0000000000 --- a/modules/sale_supply_drop_shipment/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_supply_drop_shipment' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale_amendment'), - get_require_version('trytond_stock_split'), - ] - -setup(name=name, - version=version, - description='Tryton module for sale supply drop shipment', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale supply drop shipment', - package_dir={'trytond.modules.sale_supply_drop_shipment': '.'}, - packages=( - ['trytond.modules.sale_supply_drop_shipment'] - + ['trytond.modules.sale_supply_drop_shipment.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_supply_drop_shipment': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - 'Topic :: Office/Business :: Financial :: Accounting', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_supply_drop_shipment = trytond.modules.sale_supply_drop_shipment - """, - ) diff --git a/modules/sale_supply_drop_shipment/tox.ini b/modules/sale_supply_drop_shipment/tox.ini index 53e3ce4cf0..9858981b25 100644 --- a/modules/sale_supply_drop_shipment/tox.ini +++ b/modules/sale_supply_drop_shipment/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_supply_drop_shipment --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_supply_drop_shipment {posargs} commands_post = coverage report coverage xml diff --git a/modules/sale_supply_production/COPYRIGHT b/modules/sale_supply_production/COPYRIGHT index f85dc624b4..01cea9b9c1 100644 --- a/modules/sale_supply_production/COPYRIGHT +++ b/modules/sale_supply_production/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2020-2025 B2CK -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL +Copyright (C) 2020-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/sale_supply_production/MANIFEST.in b/modules/sale_supply_production/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/sale_supply_production/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/sale_supply_production/doc/conf.py b/modules/sale_supply_production/doc/conf.py index 913a845e64..2283ac1c0a 100644 --- a/modules/sale_supply_production/doc/conf.py +++ b/modules/sale_supply_production/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/sale_supply_production/doc/requirements-doc.txt b/modules/sale_supply_production/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/sale_supply_production/doc/requirements-doc.txt +++ b/modules/sale_supply_production/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/sale_supply_production/pyproject.toml b/modules/sale_supply_production/pyproject.toml new file mode 100644 index 0000000000..38fa0f4726 --- /dev/null +++ b/modules/sale_supply_production/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_sale_supply_production' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Supply sales using productions in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "sale", "production"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Office/Business :: Financial :: Point-Of-Sale", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +sale_supply_production = 'trytond.modules.sale_supply_production' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-sale-supply-production/" +changelog = "https://docs.tryton.org/modules-sale-supply-production/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/sale_supply_production" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/sale_supply_production/setup.py b/modules/sale_supply_production/setup.py deleted file mode 100755 index 9d30491bac..0000000000 --- a/modules/sale_supply_production/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - if slice: - content = '\n'.join(content.splitlines()[slice]) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_sale_supply_production' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_production_routing'), - ] - -setup(name=name, - version=version, - description='Tryton module to supply sales from production', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton sale supply production', - package_dir={'trytond.modules.sale_supply_production': '.'}, - packages=( - ['trytond.modules.sale_supply_production'] - + ['trytond.modules.sale_supply_production.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.sale_supply_production': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - sale_supply_production = trytond.modules.sale_supply_production - """, # noqa: E501 - ) diff --git a/modules/sale_supply_production/tox.ini b/modules/sale_supply_production/tox.ini index 53e3ce4cf0..dc8a59b4e9 100644 --- a/modules/sale_supply_production/tox.ini +++ b/modules/sale_supply_production/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.sale_supply_production --omit=*/tests/* -m xmlrunner discover -s trytond.modules.sale_supply_production {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock/COPYRIGHT b/modules/stock/COPYRIGHT index c937ec760a..2eabb13fbe 100644 --- a/modules/stock/COPYRIGHT +++ b/modules/stock/COPYRIGHT @@ -1,8 +1,8 @@ -Copyright (C) 2012 Openlabs Technologies & Consulting (P) LTD. -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2004-2008 Tiny SPRL. +Copyright (C) 2012 Openlabs Technologies & Consulting (P) LTD +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2004-2008 Tiny SPRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock/MANIFEST.in b/modules/stock/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock/doc/conf.py b/modules/stock/doc/conf.py index c8e985e2e1..c9c2f554dc 100644 --- a/modules/stock/doc/conf.py +++ b/modules/stock/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock/doc/requirements-doc.txt b/modules/stock/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock/doc/requirements-doc.txt +++ b/modules/stock/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock/pyproject.toml b/modules/stock/pyproject.toml new file mode 100644 index 0000000000..0aa41b90ff --- /dev/null +++ b/modules/stock/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Stock and inventories for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock", "shipment"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock = 'trytond.modules.stock' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock/" +changelog = "https://docs.tryton.org/modules-stock/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-sql >= 1.3.0', + 'simpleeval', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock/setup.py b/modules/stock/setup.py deleted file mode 100755 index 8b4916af1e..0000000000 --- a/modules/stock/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 1.3.0', 'simpleeval'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for stock and inventory', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-stock/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock', - package_dir={'trytond.modules.stock': '.'}, - packages=( - ['trytond.modules.stock'] - + ['trytond.modules.stock.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock = trytond.modules.stock - """, - ) diff --git a/modules/stock/tox.ini b/modules/stock/tox.ini index 53e3ce4cf0..6930b3063b 100644 --- a/modules/stock/tox.ini +++ b/modules/stock/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_assign_manual/COPYRIGHT b/modules/stock_assign_manual/COPYRIGHT index 26cedee5ea..83cca03ba3 100644 --- a/modules/stock_assign_manual/COPYRIGHT +++ b/modules/stock_assign_manual/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_assign_manual/MANIFEST.in b/modules/stock_assign_manual/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_assign_manual/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_assign_manual/doc/conf.py b/modules/stock_assign_manual/doc/conf.py index a647457e1f..f4f2df69a9 100644 --- a/modules/stock_assign_manual/doc/conf.py +++ b/modules/stock_assign_manual/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_assign_manual/doc/requirements-doc.txt b/modules/stock_assign_manual/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_assign_manual/doc/requirements-doc.txt +++ b/modules/stock_assign_manual/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_assign_manual/pyproject.toml b/modules/stock_assign_manual/pyproject.toml new file mode 100644 index 0000000000..3c2ff4ced1 --- /dev/null +++ b/modules/stock_assign_manual/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_assign_manual' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Manual assignation of stock for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock", "shipment"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_assign_manual = 'trytond.modules.stock_assign_manual' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-assign-manual/" +changelog = "https://docs.tryton.org/modules-stock-assign-manual/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_assign_manual" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_assign_manual/setup.py b/modules/stock_assign_manual/setup.py deleted file mode 100755 index 2e980bf0b9..0000000000 --- a/modules/stock_assign_manual/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - if slice: - content = '\n'.join(content.splitlines()[slice]) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_assign_manual' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_production'), - ] - -setup(name=name, - version=version, - description='Tryton module to assign manually stock move', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock assign', - package_dir={'trytond.modules.stock_assign_manual': '.'}, - packages=( - ['trytond.modules.stock_assign_manual'] - + ['trytond.modules.stock_assign_manual.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_assign_manual': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_assign_manual = trytond.modules.stock_assign_manual - """, # noqa: E501 - ) diff --git a/modules/stock_assign_manual/tox.ini b/modules/stock_assign_manual/tox.ini index 53e3ce4cf0..d893e53273 100644 --- a/modules/stock_assign_manual/tox.ini +++ b/modules/stock_assign_manual/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_assign_manual --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_assign_manual {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_consignment/COPYRIGHT b/modules/stock_consignment/COPYRIGHT index 9512eceaed..6f3a8ebb90 100644 --- a/modules/stock_consignment/COPYRIGHT +++ b/modules/stock_consignment/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2017-2025 Cédric Krier -Copyright (C) 2017-2025 B2CK +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_consignment/MANIFEST.in b/modules/stock_consignment/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_consignment/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_consignment/doc/conf.py b/modules/stock_consignment/doc/conf.py index 95870c0755..bf57f6893c 100644 --- a/modules/stock_consignment/doc/conf.py +++ b/modules/stock_consignment/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_consignment/doc/requirements-doc.txt b/modules/stock_consignment/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_consignment/doc/requirements-doc.txt +++ b/modules/stock_consignment/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_consignment/pyproject.toml b/modules/stock_consignment/pyproject.toml new file mode 100644 index 0000000000..910eaaee85 --- /dev/null +++ b/modules/stock_consignment/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_consignment' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Stock consignments for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_consignment = 'trytond.modules.stock_consignment' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-consignment/" +changelog = "https://docs.tryton.org/modules-stock-consignment/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_consignment" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_consignment/setup.py b/modules/stock_consignment/setup.py deleted file mode 100755 index 0bcfd9352a..0000000000 --- a/modules/stock_consignment/setup.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_consignment' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_stock_supply')] - -setup(name=name, - version=version, - description='Tryton module to manage consignment stock', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock consignment', - package_dir={'trytond.modules.stock_consignment': '.'}, - packages=( - ['trytond.modules.stock_consignment'] - + ['trytond.modules.stock_consignment.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_consignment': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_consignment = trytond.modules.stock_consignment - """, - ) diff --git a/modules/stock_consignment/tox.ini b/modules/stock_consignment/tox.ini index 53e3ce4cf0..6326c6ce5a 100644 --- a/modules/stock_consignment/tox.ini +++ b/modules/stock_consignment/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_consignment --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_consignment {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_forecast/COPYRIGHT b/modules/stock_forecast/COPYRIGHT index a392859693..dc839cb31b 100644 --- a/modules/stock_forecast/COPYRIGHT +++ b/modules/stock_forecast/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_forecast/MANIFEST.in b/modules/stock_forecast/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_forecast/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_forecast/doc/conf.py b/modules/stock_forecast/doc/conf.py index 0c4b5323c6..4295b248f4 100644 --- a/modules/stock_forecast/doc/conf.py +++ b/modules/stock_forecast/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_forecast/doc/requirements-doc.txt b/modules/stock_forecast/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_forecast/doc/requirements-doc.txt +++ b/modules/stock_forecast/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_forecast/pyproject.toml b/modules/stock_forecast/pyproject.toml new file mode 100644 index 0000000000..b250bd01da --- /dev/null +++ b/modules/stock_forecast/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_forecast' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Stock forecasts for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_forecast = 'trytond.modules.stock_forecast' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-forecast/" +changelog = "https://docs.tryton.org/modules-stock-forecast/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_forecast" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'python-dateutil', + 'python-sql >= 0.4', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/stock_forecast/setup.py b/modules/stock_forecast/setup.py deleted file mode 100755 index eb24e4876e..0000000000 --- a/modules/stock_forecast/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_forecast' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-dateutil', 'python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module with stock forecasts', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/projects/modules-stock-forecast'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock forecast', - package_dir={'trytond.modules.stock_forecast': '.'}, - packages=( - ['trytond.modules.stock_forecast'] - + ['trytond.modules.stock_forecast.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_forecast': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_forecast = trytond.modules.stock_forecast - """, - ) diff --git a/modules/stock_forecast/tox.ini b/modules/stock_forecast/tox.ini index 53e3ce4cf0..6c67580a53 100644 --- a/modules/stock_forecast/tox.ini +++ b/modules/stock_forecast/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_forecast --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_forecast {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_inventory_location/COPYRIGHT b/modules/stock_inventory_location/COPYRIGHT index 3c933baa0c..e8c9eb806d 100644 --- a/modules/stock_inventory_location/COPYRIGHT +++ b/modules/stock_inventory_location/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2009-2025 Cédric Krier. -Copyright (C) 2009-2012 Bertrand Chenal. -Copyright (C) 2009-2025 B2CK SPRL. +Copyright (C) 2009-2025 Cédric Krier +Copyright (C) 2009-2012 Bertrand Chenal +Copyright (C) 2009-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_inventory_location/MANIFEST.in b/modules/stock_inventory_location/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_inventory_location/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_inventory_location/doc/conf.py b/modules/stock_inventory_location/doc/conf.py index b79e37aa75..666afa0f73 100644 --- a/modules/stock_inventory_location/doc/conf.py +++ b/modules/stock_inventory_location/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_inventory_location/doc/requirements-doc.txt b/modules/stock_inventory_location/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_inventory_location/doc/requirements-doc.txt +++ b/modules/stock_inventory_location/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_inventory_location/pyproject.toml b/modules/stock_inventory_location/pyproject.toml new file mode 100644 index 0000000000..307b49c1e4 --- /dev/null +++ b/modules/stock_inventory_location/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_inventory_location' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Stock inventories by locations for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_inventory_location = 'trytond.modules.stock_inventory_location' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-inventory-location/" +changelog = "https://docs.tryton.org/modules-stock-inventory-location/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_inventory_location" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_inventory_location/setup.py b/modules/stock_inventory_location/setup.py deleted file mode 100755 index c9d68582bf..0000000000 --- a/modules/stock_inventory_location/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_inventory_location' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to create inventories by locations', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton inventory location', - package_dir={'trytond.modules.stock_inventory_location': '.'}, - packages=( - ['trytond.modules.stock_inventory_location'] - + ['trytond.modules.stock_inventory_location.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_inventory_location': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_inventory_location = trytond.modules.stock_inventory_location - """, - ) diff --git a/modules/stock_inventory_location/tox.ini b/modules/stock_inventory_location/tox.ini index 53e3ce4cf0..6c218ae3e4 100644 --- a/modules/stock_inventory_location/tox.ini +++ b/modules/stock_inventory_location/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_inventory_location --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_inventory_location {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_location_move/COPYRIGHT b/modules/stock_location_move/COPYRIGHT index ae52665ab2..6f3a8ebb90 100644 --- a/modules/stock_location_move/COPYRIGHT +++ b/modules/stock_location_move/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_location_move/MANIFEST.in b/modules/stock_location_move/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_location_move/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_location_move/doc/conf.py b/modules/stock_location_move/doc/conf.py index 6c61ecad7f..f210678174 100644 --- a/modules/stock_location_move/doc/conf.py +++ b/modules/stock_location_move/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_location_move/doc/requirements-doc.txt b/modules/stock_location_move/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_location_move/doc/requirements-doc.txt +++ b/modules/stock_location_move/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_location_move/pyproject.toml b/modules/stock_location_move/pyproject.toml new file mode 100644 index 0000000000..b56f3098ea --- /dev/null +++ b/modules/stock_location_move/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_location_move' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Storage location movable for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_location_move = 'trytond.modules.stock_location_move' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-location-move/" +changelog = "https://docs.tryton.org/modules-stock-location-move/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_location_move" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_location_move/setup.py b/modules/stock_location_move/setup.py deleted file mode 100755 index b9ace2ee00..0000000000 --- a/modules/stock_location_move/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_location_move' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] -for dep in info.get('extras_depend', []): - tests_require.append(get_require_version('trytond_%s' % dep)) - -setup(name=name, - version=version, - description='Tryton module to move storage locations', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock location', - package_dir={'trytond.modules.stock_location_move': '.'}, - packages=( - ['trytond.modules.stock_location_move'] - + ['trytond.modules.stock_location_move.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_location_move': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_location_move = trytond.modules.stock_location_move - """, - ) diff --git a/modules/stock_location_move/tox.ini b/modules/stock_location_move/tox.ini index 53e3ce4cf0..bf06c87272 100644 --- a/modules/stock_location_move/tox.ini +++ b/modules/stock_location_move/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_location_move --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_location_move {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_location_sequence/COPYRIGHT b/modules/stock_location_sequence/COPYRIGHT index f9702c30ca..bfecfa3ea1 100644 --- a/modules/stock_location_sequence/COPYRIGHT +++ b/modules/stock_location_sequence/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2012 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2012 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_location_sequence/MANIFEST.in b/modules/stock_location_sequence/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_location_sequence/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_location_sequence/doc/conf.py b/modules/stock_location_sequence/doc/conf.py index 3764f6ee1c..0b7ddcb07a 100644 --- a/modules/stock_location_sequence/doc/conf.py +++ b/modules/stock_location_sequence/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_location_sequence/doc/requirements-doc.txt b/modules/stock_location_sequence/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_location_sequence/doc/requirements-doc.txt +++ b/modules/stock_location_sequence/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_location_sequence/pyproject.toml b/modules/stock_location_sequence/pyproject.toml new file mode 100644 index 0000000000..538cc10e90 --- /dev/null +++ b/modules/stock_location_sequence/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_location_sequence' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Stock location ordering for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_location_sequence = 'trytond.modules.stock_location_sequence' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-location-sequence/" +changelog = "https://docs.tryton.org/modules-stock-location-sequence/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_location_sequence" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/stock_location_sequence/setup.py b/modules/stock_location_sequence/setup.py deleted file mode 100755 index 428d20cb3b..0000000000 --- a/modules/stock_location_sequence/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_location_sequence' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to add sequence on location', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock location sequence', - package_dir={'trytond.modules.stock_location_sequence': '.'}, - packages=( - ['trytond.modules.stock_location_sequence'] - + ['trytond.modules.stock_location_sequence.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_location_sequence': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_location_sequence = trytond.modules.stock_location_sequence - """, - ) diff --git a/modules/stock_location_sequence/tox.ini b/modules/stock_location_sequence/tox.ini index 53e3ce4cf0..166682a6fa 100644 --- a/modules/stock_location_sequence/tox.ini +++ b/modules/stock_location_sequence/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_location_sequence --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_location_sequence {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_lot/COPYRIGHT b/modules/stock_lot/COPYRIGHT index 455be7decc..2694803af1 100644 --- a/modules/stock_lot/COPYRIGHT +++ b/modules/stock_lot/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2012-2025 Cédric Krier. -Copyright (C) 2012-2025 B2CK SPRL. +Copyright (C) 2012-2025 Cédric Krier +Copyright (C) 2012-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_lot/MANIFEST.in b/modules/stock_lot/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_lot/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_lot/doc/conf.py b/modules/stock_lot/doc/conf.py index 302d45612b..37e5b931e9 100644 --- a/modules/stock_lot/doc/conf.py +++ b/modules/stock_lot/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_lot/doc/requirements-doc.txt b/modules/stock_lot/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_lot/doc/requirements-doc.txt +++ b/modules/stock_lot/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_lot/pyproject.toml b/modules/stock_lot/pyproject.toml new file mode 100644 index 0000000000..1c3d689bc8 --- /dev/null +++ b/modules/stock_lot/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_lot' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Stock lots for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_lot = 'trytond.modules.stock_lot' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-lot/" +changelog = "https://docs.tryton.org/modules-stock-lot/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_lot" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_lot/setup.py b/modules/stock_lot/setup.py deleted file mode 100755 index b7c83660c0..0000000000 --- a/modules/stock_lot/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_lot' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_stock_split'), - ] - -setup(name=name, - version=version, - description='Tryton module for lot of products', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/projects/modules-stock-lot/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock lot', - package_dir={'trytond.modules.stock_lot': '.'}, - packages=( - ['trytond.modules.stock_lot'] - + ['trytond.modules.stock_lot.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_lot': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_lot = trytond.modules.stock_lot - """, - ) diff --git a/modules/stock_lot/tox.ini b/modules/stock_lot/tox.ini index 53e3ce4cf0..b04b5c7259 100644 --- a/modules/stock_lot/tox.ini +++ b/modules/stock_lot/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_lot --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_lot {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_lot_sled/COPYRIGHT b/modules/stock_lot_sled/COPYRIGHT index 7a81e27cbc..baa38b1cf4 100644 --- a/modules/stock_lot_sled/COPYRIGHT +++ b/modules/stock_lot_sled/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2014-2025 Cédric Krier. -Copyright (C) 2014-2025 B2CK SPRL. -Copyright (C) 2013-2015 NaN·tic +Copyright (C) 2014-2025 Cédric Krier +Copyright (C) 2014-2025 B2CK SRL +Copyright (C) 2013-2015 NaN-tic This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_lot_sled/MANIFEST.in b/modules/stock_lot_sled/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_lot_sled/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_lot_sled/doc/conf.py b/modules/stock_lot_sled/doc/conf.py index 96f83f03b4..07322937fc 100644 --- a/modules/stock_lot_sled/doc/conf.py +++ b/modules/stock_lot_sled/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_lot_sled/doc/requirements-doc.txt b/modules/stock_lot_sled/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_lot_sled/doc/requirements-doc.txt +++ b/modules/stock_lot_sled/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_lot_sled/pyproject.toml b/modules/stock_lot_sled/pyproject.toml new file mode 100644 index 0000000000..b3e780e930 --- /dev/null +++ b/modules/stock_lot_sled/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_lot_sled' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shelf live expiration dates for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_lot_sled = 'trytond.modules.stock_lot_sled' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-lot-sled/" +changelog = "https://docs.tryton.org/modules-stock-lot-sled/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_lot_sled" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.5'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/stock_lot_sled/setup.py b/modules/stock_lot_sled/setup.py deleted file mode 100755 index d5369c3c92..0000000000 --- a/modules/stock_lot_sled/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_lot_sled' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.5'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module for shelf life expiration date of product lots', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock lot', - package_dir={'trytond.modules.stock_lot_sled': '.'}, - packages=( - ['trytond.modules.stock_lot_sled'] - + ['trytond.modules.stock_lot_sled.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_lot_sled': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_lot_sled = trytond.modules.stock_lot_sled - """, - ) diff --git a/modules/stock_lot_sled/tox.ini b/modules/stock_lot_sled/tox.ini index 53e3ce4cf0..a94c26317f 100644 --- a/modules/stock_lot_sled/tox.ini +++ b/modules/stock_lot_sled/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_lot_sled --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_lot_sled {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_lot_unit/COPYRIGHT b/modules/stock_lot_unit/COPYRIGHT index 2b38234935..d1e30fda7f 100644 --- a/modules/stock_lot_unit/COPYRIGHT +++ b/modules/stock_lot_unit/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2018-2025 Cédric Krier -Copyright (C) 2017-2025 Nicolas Évrard -Copyright (C) 2017-2025 B2CK +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2017-2025 Nicolas Évrard +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_lot_unit/MANIFEST.in b/modules/stock_lot_unit/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_lot_unit/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_lot_unit/doc/conf.py b/modules/stock_lot_unit/doc/conf.py index b6306bc766..e387cc66f3 100644 --- a/modules/stock_lot_unit/doc/conf.py +++ b/modules/stock_lot_unit/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_lot_unit/doc/requirements-doc.txt b/modules/stock_lot_unit/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_lot_unit/doc/requirements-doc.txt +++ b/modules/stock_lot_unit/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_lot_unit/pyproject.toml b/modules/stock_lot_unit/pyproject.toml new file mode 100644 index 0000000000..975bbf3d81 --- /dev/null +++ b/modules/stock_lot_unit/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_lot_unit' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Units for stock lots in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_lot_unit = 'trytond.modules.stock_lot_unit' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-lot-unit/" +changelog = "https://docs.tryton.org/modules-stock-lot-unit/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_lot_unit" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_lot_unit/setup.py b/modules/stock_lot_unit/setup.py deleted file mode 100755 index 9007527f01..0000000000 --- a/modules/stock_lot_unit/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_lot_unit' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus'), - get_require_version('trytond_production')] - -setup(name=name, - version=version, - description='Tryton module to define unit on stock lot', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock lot unit serial', - package_dir={'trytond.modules.stock_lot_unit': '.'}, - packages=( - ['trytond.modules.stock_lot_unit'] - + ['trytond.modules.stock_lot_unit.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_lot_unit': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_lot_unit = trytond.modules.stock_lot_unit - """, - ) diff --git a/modules/stock_lot_unit/tox.ini b/modules/stock_lot_unit/tox.ini index 53e3ce4cf0..fb7eca8467 100644 --- a/modules/stock_lot_unit/tox.ini +++ b/modules/stock_lot_unit/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_lot_unit --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_lot_unit {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_package/COPYRIGHT b/modules/stock_package/COPYRIGHT index c5f9863cf1..a2d4e65b8c 100644 --- a/modules/stock_package/COPYRIGHT +++ b/modules/stock_package/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2013-2025 Cédric Krier. -Copyright (C) 2013-2025 B2CK SPRL. +Copyright (C) 2013-2025 Cédric Krier +Copyright (C) 2013-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_package/MANIFEST.in b/modules/stock_package/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_package/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_package/doc/conf.py b/modules/stock_package/doc/conf.py index 11fc064e9b..c4d1fbcf7d 100644 --- a/modules/stock_package/doc/conf.py +++ b/modules/stock_package/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_package/doc/requirements-doc.txt b/modules/stock_package/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_package/doc/requirements-doc.txt +++ b/modules/stock_package/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_package/pyproject.toml b/modules/stock_package/pyproject.toml new file mode 100644 index 0000000000..707f8d4924 --- /dev/null +++ b/modules/stock_package/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_package' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Stock packaging for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_package = 'trytond.modules.stock_package' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-package/" +changelog = "https://docs.tryton.org/modules-stock-package/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_package" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_package/setup.py b/modules/stock_package/setup.py deleted file mode 100755 index 84cec9f0e9..0000000000 --- a/modules/stock_package/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_package' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for stock packaging', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock packaging', - package_dir={'trytond.modules.stock_package': '.'}, - packages=( - ['trytond.modules.stock_package'] - + ['trytond.modules.stock_package.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_package': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_package = trytond.modules.stock_package - """, - ) diff --git a/modules/stock_package/tox.ini b/modules/stock_package/tox.ini index 53e3ce4cf0..97f18c9a86 100644 --- a/modules/stock_package/tox.ini +++ b/modules/stock_package/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_package --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_package {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_package_shipping/COPYRIGHT b/modules/stock_package_shipping/COPYRIGHT index 6635461376..1c416333c6 100644 --- a/modules/stock_package_shipping/COPYRIGHT +++ b/modules/stock_package_shipping/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2016-2025 Nicolas Évrard. -Copyright (C) 2016-2025 B2CK. +Copyright (C) 2016-2025 Nicolas Évrard +Copyright (C) 2016-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_package_shipping/MANIFEST.in b/modules/stock_package_shipping/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_package_shipping/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_package_shipping/doc/conf.py b/modules/stock_package_shipping/doc/conf.py index ca66c8e4e6..c35b36f660 100644 --- a/modules/stock_package_shipping/doc/conf.py +++ b/modules/stock_package_shipping/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_package_shipping/doc/requirements-doc.txt b/modules/stock_package_shipping/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_package_shipping/doc/requirements-doc.txt +++ b/modules/stock_package_shipping/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_package_shipping/pyproject.toml b/modules/stock_package_shipping/pyproject.toml new file mode 100644 index 0000000000..45ef9e04f5 --- /dev/null +++ b/modules/stock_package_shipping/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_package_shipping' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Package shipping for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_package_shipping = 'trytond.modules.stock_package_shipping' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-package-shipping/" +changelog = "https://docs.tryton.org/modules-stock-package-shipping/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_package_shipping" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_package_shipping/setup.py b/modules/stock_package_shipping/setup.py deleted file mode 100755 index 4f48c79eea..0000000000 --- a/modules/stock_package_shipping/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_package_shipping' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description=('The package shipping module of the ' - 'Tryton application platform.'), - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock package shipping', - package_dir={'trytond.modules.stock_package_shipping': '.'}, - packages=( - ['trytond.modules.stock_package_shipping'] - + ['trytond.modules.stock_package_shipping.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_package_shipping': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_package_shipping = trytond.modules.stock_package_shipping - """, - ) diff --git a/modules/stock_package_shipping/tox.ini b/modules/stock_package_shipping/tox.ini index 53e3ce4cf0..fb4a13f2be 100644 --- a/modules/stock_package_shipping/tox.ini +++ b/modules/stock_package_shipping/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_package_shipping --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_package_shipping {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_package_shipping_dpd/COPYRIGHT b/modules/stock_package_shipping_dpd/COPYRIGHT index 4e54ebe2b2..cdbb8c40bf 100644 --- a/modules/stock_package_shipping_dpd/COPYRIGHT +++ b/modules/stock_package_shipping_dpd/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2016-2025 B2CK. -Copyright (C) 2016-2025 Nicolas Évrard. +Copyright (C) 2016-2025 B2CK SRL +Copyright (C) 2016-2025 Nicolas Évrard This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_package_shipping_dpd/MANIFEST.in b/modules/stock_package_shipping_dpd/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_package_shipping_dpd/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_package_shipping_dpd/doc/conf.py b/modules/stock_package_shipping_dpd/doc/conf.py index 95807950ab..693cf124e2 100644 --- a/modules/stock_package_shipping_dpd/doc/conf.py +++ b/modules/stock_package_shipping_dpd/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_package_shipping_dpd/doc/requirements-doc.txt b/modules/stock_package_shipping_dpd/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_package_shipping_dpd/doc/requirements-doc.txt +++ b/modules/stock_package_shipping_dpd/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_package_shipping_dpd/pyproject.toml b/modules/stock_package_shipping_dpd/pyproject.toml new file mode 100644 index 0000000000..401d50c8bc --- /dev/null +++ b/modules/stock_package_shipping_dpd/pyproject.toml @@ -0,0 +1,67 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_package_shipping_dpd' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Package shipping with DPD for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_package_shipping_dpd = 'trytond.modules.stock_package_shipping_dpd' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-package-shipping-dpd/" +changelog = "https://docs.tryton.org/modules-stock-package-shipping-dpd/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_package_shipping_dpd" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'lxml', + 'pypdf >= 3', + 'zeep >= 0.12', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_sale', + 'trytond_sale_shipment_cost', + ] diff --git a/modules/stock_package_shipping_dpd/setup.py b/modules/stock_package_shipping_dpd/setup.py deleted file mode 100755 index 83d816647c..0000000000 --- a/modules/stock_package_shipping_dpd/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_package_shipping_dpd' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['zeep >= 0.12', 'pypdf >= 3', 'lxml'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_incoterm'), - get_require_version('trytond_sale'), - get_require_version('trytond_sale_shipment_cost'), - get_require_version('trytond_stock_shipment_customs'), - ] - -setup(name=name, - version=version, - description='DPD connector for the Tryton application platform', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock package shipping dpd', - package_dir={'trytond.modules.stock_package_shipping_dpd': '.'}, - packages=( - ['trytond.modules.stock_package_shipping_dpd'] - + ['trytond.modules.stock_package_shipping_dpd.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_package_shipping_dpd': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_package_shipping_dpd = trytond.modules.stock_package_shipping_dpd - """, - ) diff --git a/modules/stock_package_shipping_dpd/tox.ini b/modules/stock_package_shipping_dpd/tox.ini index 53e3ce4cf0..e7e766d000 100644 --- a/modules/stock_package_shipping_dpd/tox.ini +++ b/modules/stock_package_shipping_dpd/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_package_shipping_dpd --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_package_shipping_dpd {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_package_shipping_mygls/COPYRIGHT b/modules/stock_package_shipping_mygls/COPYRIGHT index 523289548e..202b682dd7 100644 --- a/modules/stock_package_shipping_mygls/COPYRIGHT +++ b/modules/stock_package_shipping_mygls/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_package_shipping_mygls/MANIFEST.in b/modules/stock_package_shipping_mygls/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_package_shipping_mygls/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_package_shipping_mygls/doc/conf.py b/modules/stock_package_shipping_mygls/doc/conf.py index 46e8798691..20e8705fc2 100644 --- a/modules/stock_package_shipping_mygls/doc/conf.py +++ b/modules/stock_package_shipping_mygls/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_package_shipping_mygls/doc/requirements-doc.txt b/modules/stock_package_shipping_mygls/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_package_shipping_mygls/doc/requirements-doc.txt +++ b/modules/stock_package_shipping_mygls/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_package_shipping_mygls/pyproject.toml b/modules/stock_package_shipping_mygls/pyproject.toml new file mode 100644 index 0000000000..7c98439f16 --- /dev/null +++ b/modules/stock_package_shipping_mygls/pyproject.toml @@ -0,0 +1,66 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_package_shipping_mygls' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Package shipping with MyGSL for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_package_shipping_mygls = 'trytond.modules.stock_package_shipping_mygls' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-package-shipping-mygls/" +changelog = "https://docs.tryton.org/modules-stock-package-shipping-mygls/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_package_shipping_mygls" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'pypdf >= 3', + 'zeep', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_sale', + 'trytond_sale_shipment_cost', + ] diff --git a/modules/stock_package_shipping_mygls/setup.py b/modules/stock_package_shipping_mygls/setup.py deleted file mode 100755 index 775bfab7c3..0000000000 --- a/modules/stock_package_shipping_mygls/setup.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_package_shipping_mygls' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['zeep', 'pypdf >= 3'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale'), - get_require_version('trytond_sale_shipment_cost'), - ] - -setup(name=name, - version=version, - description='MyGLS connector for the Tryton application platform', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-stock-package-shipping-mygls'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock package shipping gls mygls', - package_dir={'trytond.modules.stock_package_shipping_mygls': '.'}, - packages=( - ['trytond.modules.stock_package_shipping_mygls'] - + ['trytond.modules.stock_package_shipping_mygls.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_package_shipping_mygls': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_package_shipping_mygls = trytond.modules.stock_package_shipping_mygls - """, # noqa: E501 - ) diff --git a/modules/stock_package_shipping_mygls/tox.ini b/modules/stock_package_shipping_mygls/tox.ini index 53e3ce4cf0..266989fe7d 100644 --- a/modules/stock_package_shipping_mygls/tox.ini +++ b/modules/stock_package_shipping_mygls/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_package_shipping_mygls --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_package_shipping_mygls {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_package_shipping_sendcloud/COPYRIGHT b/modules/stock_package_shipping_sendcloud/COPYRIGHT index 523289548e..202b682dd7 100644 --- a/modules/stock_package_shipping_sendcloud/COPYRIGHT +++ b/modules/stock_package_shipping_sendcloud/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_package_shipping_sendcloud/MANIFEST.in b/modules/stock_package_shipping_sendcloud/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_package_shipping_sendcloud/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_package_shipping_sendcloud/doc/conf.py b/modules/stock_package_shipping_sendcloud/doc/conf.py index fed0cf4c9c..ffe3754e69 100644 --- a/modules/stock_package_shipping_sendcloud/doc/conf.py +++ b/modules/stock_package_shipping_sendcloud/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_package_shipping_sendcloud/doc/requirements-doc.txt b/modules/stock_package_shipping_sendcloud/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_package_shipping_sendcloud/doc/requirements-doc.txt +++ b/modules/stock_package_shipping_sendcloud/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_package_shipping_sendcloud/pyproject.toml b/modules/stock_package_shipping_sendcloud/pyproject.toml new file mode 100644 index 0000000000..b94b4e73c4 --- /dev/null +++ b/modules/stock_package_shipping_sendcloud/pyproject.toml @@ -0,0 +1,63 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_package_shipping_sendcloud' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Package shipping with Sendcloud for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_package_shipping_sendcloud = 'trytond.modules.stock_package_shipping_sendcloud' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-package-shipping-sendcloud/" +changelog = "https://docs.tryton.org/modules-stock-package-shipping-sendcloud/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_package_shipping_sendcloud" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['requests'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_sale', + 'trytond_sale_shipment_cost', + ] diff --git a/modules/stock_package_shipping_sendcloud/setup.py b/modules/stock_package_shipping_sendcloud/setup.py deleted file mode 100755 index 418ad92fe6..0000000000 --- a/modules/stock_package_shipping_sendcloud/setup.py +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_package_shipping_sendcloud' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['requests'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_sale'), - get_require_version('trytond_sale_shipment_cost'), - get_require_version('trytond_stock_shipment_customs'), - ] - -setup(name=name, - version=version, - description='Sendcloud connector for the Tryton application platform', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-stock-package-shipping-sendcloud'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock package shipping sendcloud', - package_dir={'trytond.modules.stock_package_shipping_sendcloud': '.'}, - packages=( - ['trytond.modules.stock_package_shipping_sendcloud'] - + ['trytond.modules.stock_package_shipping_sendcloud.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_package_shipping_sendcloud': ( - info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_package_shipping_sendcloud = trytond.modules.stock_package_shipping_sendcloud - """, # noqa: E501 - ) diff --git a/modules/stock_package_shipping_sendcloud/tox.ini b/modules/stock_package_shipping_sendcloud/tox.ini index 53e3ce4cf0..470f54003c 100644 --- a/modules/stock_package_shipping_sendcloud/tox.ini +++ b/modules/stock_package_shipping_sendcloud/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_package_shipping_sendcloud --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_package_shipping_sendcloud {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_package_shipping_ups/COPYRIGHT b/modules/stock_package_shipping_ups/COPYRIGHT index 4e54ebe2b2..cdbb8c40bf 100644 --- a/modules/stock_package_shipping_ups/COPYRIGHT +++ b/modules/stock_package_shipping_ups/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2016-2025 B2CK. -Copyright (C) 2016-2025 Nicolas Évrard. +Copyright (C) 2016-2025 B2CK SRL +Copyright (C) 2016-2025 Nicolas Évrard This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_package_shipping_ups/MANIFEST.in b/modules/stock_package_shipping_ups/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_package_shipping_ups/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_package_shipping_ups/doc/conf.py b/modules/stock_package_shipping_ups/doc/conf.py index 8024506363..c325afc020 100644 --- a/modules/stock_package_shipping_ups/doc/conf.py +++ b/modules/stock_package_shipping_ups/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_package_shipping_ups/doc/requirements-doc.txt b/modules/stock_package_shipping_ups/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_package_shipping_ups/doc/requirements-doc.txt +++ b/modules/stock_package_shipping_ups/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_package_shipping_ups/pyproject.toml b/modules/stock_package_shipping_ups/pyproject.toml new file mode 100644 index 0000000000..153433a47a --- /dev/null +++ b/modules/stock_package_shipping_ups/pyproject.toml @@ -0,0 +1,67 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_package_shipping_ups' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Package shipping with UPS for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_package_shipping_ups = 'trytond.modules.stock_package_shipping_ups' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-package-shipping-ups/" +changelog = "https://docs.tryton.org/modules-stock-package-shipping-ups/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_package_shipping_ups" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'oauthlib', + 'requests', + 'requests-oauthlib', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_sale', + 'trytond_sale_shipment_cost', + ] diff --git a/modules/stock_package_shipping_ups/setup.py b/modules/stock_package_shipping_ups/setup.py deleted file mode 100755 index 7c6d7cdf97..0000000000 --- a/modules/stock_package_shipping_ups/setup.py +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_package_shipping_ups' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['requests', 'requests-oauthlib', 'oauthlib'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_customs'), - get_require_version('trytond_incoterm'), - get_require_version('trytond_sale'), - get_require_version('trytond_sale_shipment_cost'), - get_require_version('trytond_stock_shipment_customs'), - ] - -setup(name=name, - version=version, - description='UPS connector for the Tryton application platform', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-stock-package-shipping-ups'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock package shipping ups', - package_dir={'trytond.modules.stock_package_shipping_ups': '.'}, - packages=( - ['trytond.modules.stock_package_shipping_ups'] - + ['trytond.modules.stock_package_shipping_ups.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_package_shipping_ups': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_package_shipping_ups = trytond.modules.stock_package_shipping_ups - """, - ) diff --git a/modules/stock_package_shipping_ups/tox.ini b/modules/stock_package_shipping_ups/tox.ini index 53e3ce4cf0..e305cad7c3 100644 --- a/modules/stock_package_shipping_ups/tox.ini +++ b/modules/stock_package_shipping_ups/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_package_shipping_ups --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_package_shipping_ups {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_product_location/COPYRIGHT b/modules/stock_product_location/COPYRIGHT index f9702c30ca..bfecfa3ea1 100644 --- a/modules/stock_product_location/COPYRIGHT +++ b/modules/stock_product_location/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2012 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2012 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_product_location/MANIFEST.in b/modules/stock_product_location/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_product_location/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_product_location/doc/conf.py b/modules/stock_product_location/doc/conf.py index aa2e192e26..e2960e2dd8 100644 --- a/modules/stock_product_location/doc/conf.py +++ b/modules/stock_product_location/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_product_location/doc/requirements-doc.txt b/modules/stock_product_location/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_product_location/doc/requirements-doc.txt +++ b/modules/stock_product_location/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_product_location/pyproject.toml b/modules/stock_product_location/pyproject.toml new file mode 100644 index 0000000000..707573fbb4 --- /dev/null +++ b/modules/stock_product_location/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_product_location' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Stock locations for products in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_product_location = 'trytond.modules.stock_product_location' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-product-location/" +changelog = "https://docs.tryton.org/modules-stock-product-location/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_product_location" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_product_location/setup.py b/modules/stock_product_location/setup.py deleted file mode 100755 index 5a53d69a87..0000000000 --- a/modules/stock_product_location/setup.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_product_location' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] -for dep in ['production']: - tests_require.append(get_require_version('trytond_%s' % dep)) - -setup(name=name, - version=version, - description='Tryton module to add default location on product', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-stock-product-location'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock product location', - package_dir={'trytond.modules.stock_product_location': '.'}, - packages=( - ['trytond.modules.stock_product_location'] - + ['trytond.modules.stock_product_location.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_product_location': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'label.odt', - 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_product_location = trytond.modules.stock_product_location - """, - ) diff --git a/modules/stock_product_location/tox.ini b/modules/stock_product_location/tox.ini index 53e3ce4cf0..b79ff7d588 100644 --- a/modules/stock_product_location/tox.ini +++ b/modules/stock_product_location/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_product_location --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_product_location {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_product_location_place/COPYRIGHT b/modules/stock_product_location_place/COPYRIGHT index 4a054c0870..755de76340 100644 --- a/modules/stock_product_location_place/COPYRIGHT +++ b/modules/stock_product_location_place/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2023-2025 B2CK -Copyright (C) 2023-2025 Cédric Krier +Copyright (C) 2023-2025 B2CK SRL +Copyright (C) 2023-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_product_location_place/MANIFEST.in b/modules/stock_product_location_place/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_product_location_place/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_product_location_place/doc/conf.py b/modules/stock_product_location_place/doc/conf.py index 459414445e..e4e5d88ea3 100644 --- a/modules/stock_product_location_place/doc/conf.py +++ b/modules/stock_product_location_place/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_product_location_place/doc/requirements-doc.txt b/modules/stock_product_location_place/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_product_location_place/doc/requirements-doc.txt +++ b/modules/stock_product_location_place/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_product_location_place/pyproject.toml b/modules/stock_product_location_place/pyproject.toml new file mode 100644 index 0000000000..6cdf4c888f --- /dev/null +++ b/modules/stock_product_location_place/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_product_location_place' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Places in stock locations for products in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_product_location_place = 'trytond.modules.stock_product_location_place' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-product-location-place/" +changelog = "https://docs.tryton.org/modules-stock-product-location-place/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_product_location_place" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_product_location_place/setup.py b/modules/stock_product_location_place/setup.py deleted file mode 100755 index acaec5c6db..0000000000 --- a/modules/stock_product_location_place/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_product_location_place' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to define a product place for each location', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/projects/' - 'modules-stock-product-location-place'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock product warehouse location place shelf', - package_dir={'trytond.modules.stock_product_location_place': '.'}, - packages=( - ['trytond.modules.stock_product_location_place'] - + ['trytond.modules.stock_product_location_place.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_product_location_place': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_product_location_place = trytond.modules.stock_product_location_place - """, # noqa: E501 - ) diff --git a/modules/stock_product_location_place/tox.ini b/modules/stock_product_location_place/tox.ini index 53e3ce4cf0..dfa9495084 100644 --- a/modules/stock_product_location_place/tox.ini +++ b/modules/stock_product_location_place/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_product_location_place --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_product_location_place {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_quantity_early_planning/COPYRIGHT b/modules/stock_quantity_early_planning/COPYRIGHT index bb6a8a0544..e4a7445742 100644 --- a/modules/stock_quantity_early_planning/COPYRIGHT +++ b/modules/stock_quantity_early_planning/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_quantity_early_planning/MANIFEST.in b/modules/stock_quantity_early_planning/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_quantity_early_planning/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_quantity_early_planning/doc/conf.py b/modules/stock_quantity_early_planning/doc/conf.py index 21db8e4033..0b1a8a0b33 100644 --- a/modules/stock_quantity_early_planning/doc/conf.py +++ b/modules/stock_quantity_early_planning/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_quantity_early_planning/doc/requirements-doc.txt b/modules/stock_quantity_early_planning/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_quantity_early_planning/doc/requirements-doc.txt +++ b/modules/stock_quantity_early_planning/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_quantity_early_planning/pyproject.toml b/modules/stock_quantity_early_planning/pyproject.toml new file mode 100644 index 0000000000..e78e3342d9 --- /dev/null +++ b/modules/stock_quantity_early_planning/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_quantity_early_planning' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Earlier planning for shipments and productions in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock", "production"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_quantity_early_planning = 'trytond.modules.stock_quantity_early_planning' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-quantity-early-planning/" +changelog = "https://docs.tryton.org/modules-stock-quantity-early-planning/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_quantity_early_planning" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_quantity_early_planning/setup.py b/modules/stock_quantity_early_planning/setup.py deleted file mode 100755 index d70eec8362..0000000000 --- a/modules/stock_quantity_early_planning/setup.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_quantity_early_planning' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_production'), - ] - -setup(name=name, - version=version, - description='Tryton module to plan earlier shipments and productions', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ('https://docs.tryton.org/' - 'modules-stock-quantity-early-planning'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock planning shipment production', - package_dir={'trytond.modules.stock_quantity_early_planning': '.'}, - packages=( - ['trytond.modules.stock_quantity_early_planning'] - + ['trytond.modules.stock_quantity_early_planning.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_quantity_early_planning': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_quantity_early_planning = trytond.modules.stock_quantity_early_planning - """, # noqa: E501 - ) diff --git a/modules/stock_quantity_early_planning/tox.ini b/modules/stock_quantity_early_planning/tox.ini index 53e3ce4cf0..d4981fc901 100644 --- a/modules/stock_quantity_early_planning/tox.ini +++ b/modules/stock_quantity_early_planning/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_quantity_early_planning --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_quantity_early_planning {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_quantity_issue/COPYRIGHT b/modules/stock_quantity_issue/COPYRIGHT index 26cedee5ea..83cca03ba3 100644 --- a/modules/stock_quantity_issue/COPYRIGHT +++ b/modules/stock_quantity_issue/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_quantity_issue/MANIFEST.in b/modules/stock_quantity_issue/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_quantity_issue/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_quantity_issue/doc/conf.py b/modules/stock_quantity_issue/doc/conf.py index ea31a876cb..97b3ab18a6 100644 --- a/modules/stock_quantity_issue/doc/conf.py +++ b/modules/stock_quantity_issue/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_quantity_issue/doc/requirements-doc.txt b/modules/stock_quantity_issue/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_quantity_issue/doc/requirements-doc.txt +++ b/modules/stock_quantity_issue/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_quantity_issue/pyproject.toml b/modules/stock_quantity_issue/pyproject.toml new file mode 100644 index 0000000000..1edeb34f22 --- /dev/null +++ b/modules/stock_quantity_issue/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_quantity_issue' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Quantity issues for stock in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_quantity_issue = 'trytond.modules.stock_quantity_issue' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-quantity-issue/" +changelog = "https://docs.tryton.org/modules-stock-quantity-issue/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_quantity_issue" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_quantity_issue/setup.py b/modules/stock_quantity_issue/setup.py deleted file mode 100755 index 486027f1d9..0000000000 --- a/modules/stock_quantity_issue/setup.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_quantity_issue' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_production'), - ] - -setup(name=name, - version=version, - description='Tryton module to manage quantity issue with stock', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-stock-quantity-issue/'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock quantity issue shipment production', - package_dir={'trytond.modules.stock_quantity_issue': '.'}, - packages=( - ['trytond.modules.stock_quantity_issue'] - + ['trytond.modules.stock_quantity_issue.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_quantity_issue': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_quantity_issue = trytond.modules.stock_quantity_issue - """, # noqa: E501 - ) diff --git a/modules/stock_quantity_issue/tox.ini b/modules/stock_quantity_issue/tox.ini index 53e3ce4cf0..0384eecaf5 100644 --- a/modules/stock_quantity_issue/tox.ini +++ b/modules/stock_quantity_issue/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_quantity_issue --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_quantity_issue {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_secondary_unit/COPYRIGHT b/modules/stock_secondary_unit/COPYRIGHT index e42fe356fc..e7dd2b7778 100644 --- a/modules/stock_secondary_unit/COPYRIGHT +++ b/modules/stock_secondary_unit/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2019-2025 Cédric Krier -Copyright (C) 2019-2025 B2CK +Copyright (C) 2019-2025 Cédric Krier +Copyright (C) 2019-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_secondary_unit/MANIFEST.in b/modules/stock_secondary_unit/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_secondary_unit/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_secondary_unit/doc/conf.py b/modules/stock_secondary_unit/doc/conf.py index 9c8c288dd6..7662145744 100644 --- a/modules/stock_secondary_unit/doc/conf.py +++ b/modules/stock_secondary_unit/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_secondary_unit/doc/requirements-doc.txt b/modules/stock_secondary_unit/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_secondary_unit/doc/requirements-doc.txt +++ b/modules/stock_secondary_unit/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_secondary_unit/pyproject.toml b/modules/stock_secondary_unit/pyproject.toml new file mode 100644 index 0000000000..a6ee5a7721 --- /dev/null +++ b/modules/stock_secondary_unit/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_secondary_unit' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Secondary unit for stock in Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_secondary_unit = 'trytond.modules.stock_secondary_unit' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-secondary-unit/" +changelog = "https://docs.tryton.org/modules-stock-secondary-unit/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_secondary_unit" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/stock_secondary_unit/setup.py b/modules/stock_secondary_unit/setup.py deleted file mode 100755 index 779291657d..0000000000 --- a/modules/stock_secondary_unit/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_secondary_unit' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to add a secondary unit on stock move', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock secondary unit', - package_dir={'trytond.modules.stock_secondary_unit': '.'}, - packages=( - ['trytond.modules.stock_secondary_unit'] - + ['trytond.modules.stock_secondary_unit.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_secondary_unit': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_secondary_unit = trytond.modules.stock_secondary_unit - """, - ) diff --git a/modules/stock_secondary_unit/tox.ini b/modules/stock_secondary_unit/tox.ini index 53e3ce4cf0..330663bdd9 100644 --- a/modules/stock_secondary_unit/tox.ini +++ b/modules/stock_secondary_unit/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_secondary_unit --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_secondary_unit {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_shipment_cost/COPYRIGHT b/modules/stock_shipment_cost/COPYRIGHT index f85dc624b4..01cea9b9c1 100644 --- a/modules/stock_shipment_cost/COPYRIGHT +++ b/modules/stock_shipment_cost/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2020-2025 B2CK -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL +Copyright (C) 2020-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_shipment_cost/MANIFEST.in b/modules/stock_shipment_cost/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_shipment_cost/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_shipment_cost/doc/conf.py b/modules/stock_shipment_cost/doc/conf.py index 13240c0d4d..9252e25a4c 100644 --- a/modules/stock_shipment_cost/doc/conf.py +++ b/modules/stock_shipment_cost/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_shipment_cost/doc/requirements-doc.txt b/modules/stock_shipment_cost/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_shipment_cost/doc/requirements-doc.txt +++ b/modules/stock_shipment_cost/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_shipment_cost/pyproject.toml b/modules/stock_shipment_cost/pyproject.toml new file mode 100644 index 0000000000..2010d49896 --- /dev/null +++ b/modules/stock_shipment_cost/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_shipment_cost' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shipment cost for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_shipment_cost = 'trytond.modules.stock_shipment_cost' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-shipment-cost/" +changelog = "https://docs.tryton.org/modules-stock-shipment-cost/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_shipment_cost" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_shipment_cost/setup.py b/modules/stock_shipment_cost/setup.py deleted file mode 100755 index 1fc9b8146b..0000000000 --- a/modules/stock_shipment_cost/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_shipment_cost' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for stock shipment cost', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-stock-shipment-cost/'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock shipment cost', - package_dir={'trytond.modules.stock_shipment_cost': '.'}, - packages=( - ['trytond.modules.stock_shipment_cost'] - + ['trytond.modules.stock_shipment_cost.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_shipment_cost': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_shipment_cost = trytond.modules.stock_shipment_cost - """, # noqa: E501 - ) diff --git a/modules/stock_shipment_cost/tox.ini b/modules/stock_shipment_cost/tox.ini index 53e3ce4cf0..e47f438c1b 100644 --- a/modules/stock_shipment_cost/tox.ini +++ b/modules/stock_shipment_cost/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_shipment_cost --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_shipment_cost {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_shipment_cost_weight/COPYRIGHT b/modules/stock_shipment_cost_weight/COPYRIGHT index 0c79bf8b9b..2abf8ccad4 100644 --- a/modules/stock_shipment_cost_weight/COPYRIGHT +++ b/modules/stock_shipment_cost_weight/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2022-2025 B2CK -Copyright (C) 2022-2025 Cédric Krier +Copyright (C) 2022-2025 B2CK SRL +Copyright (C) 2022-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_shipment_cost_weight/MANIFEST.in b/modules/stock_shipment_cost_weight/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_shipment_cost_weight/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_shipment_cost_weight/doc/conf.py b/modules/stock_shipment_cost_weight/doc/conf.py index 9d8173a1ea..3627fa4a01 100644 --- a/modules/stock_shipment_cost_weight/doc/conf.py +++ b/modules/stock_shipment_cost_weight/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_shipment_cost_weight/doc/requirements-doc.txt b/modules/stock_shipment_cost_weight/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_shipment_cost_weight/doc/requirements-doc.txt +++ b/modules/stock_shipment_cost_weight/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_shipment_cost_weight/pyproject.toml b/modules/stock_shipment_cost_weight/pyproject.toml new file mode 100644 index 0000000000..85d552c65d --- /dev/null +++ b/modules/stock_shipment_cost_weight/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_shipment_cost_weight' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shipment cost allocation by weight for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_shipment_cost_weight = 'trytond.modules.stock_shipment_cost_weight' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-shipment-cost-weight/" +changelog = "https://docs.tryton.org/modules-stock-shipment-cost-weight/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_shipment_cost_weight" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_shipment_cost_weight/setup.py b/modules/stock_shipment_cost_weight/setup.py deleted file mode 100755 index 58721755a4..0000000000 --- a/modules/stock_shipment_cost_weight/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_shipment_cost_weight' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to allocate shipment cost "by weight"', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-stock-shipment-cost-weight'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock shipment cost weight', - package_dir={'trytond.modules.stock_shipment_cost_weight': '.'}, - packages=( - ['trytond.modules.stock_shipment_cost_weight'] - + ['trytond.modules.stock_shipment_cost_weight.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_shipment_cost_weight': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_shipment_cost_weight = trytond.modules.stock_shipment_cost_weight - """, # noqa: E501 - ) diff --git a/modules/stock_shipment_cost_weight/tox.ini b/modules/stock_shipment_cost_weight/tox.ini index 53e3ce4cf0..ea3858b2c3 100644 --- a/modules/stock_shipment_cost_weight/tox.ini +++ b/modules/stock_shipment_cost_weight/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_shipment_cost_weight --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_shipment_cost_weight {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_shipment_customs/COPYRIGHT b/modules/stock_shipment_customs/COPYRIGHT index 604a57bdc6..835fb414bd 100644 --- a/modules/stock_shipment_customs/COPYRIGHT +++ b/modules/stock_shipment_customs/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2025 B2CK -Copyright (C) 2025 Cédric Krier +Copyright (C) 2025 B2CK SRL +Copyright (C) 2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_shipment_customs/MANIFEST.in b/modules/stock_shipment_customs/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_shipment_customs/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_shipment_customs/doc/conf.py b/modules/stock_shipment_customs/doc/conf.py index aef728c3fb..7d88a5cb04 100644 --- a/modules/stock_shipment_customs/doc/conf.py +++ b/modules/stock_shipment_customs/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_shipment_customs/doc/requirements-doc.txt b/modules/stock_shipment_customs/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_shipment_customs/doc/requirements-doc.txt +++ b/modules/stock_shipment_customs/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_shipment_customs/pyproject.toml b/modules/stock_shipment_customs/pyproject.toml new file mode 100644 index 0000000000..2e90f59c0e --- /dev/null +++ b/modules/stock_shipment_customs/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_shipment_customs' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "international shipping for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_shipment_customs = 'trytond.modules.stock_shipment_customs' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-shipment-customs/" +changelog = "https://docs.tryton.org/modules-stock-shipment-customs/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_shipment_customs" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_shipment_customs/setup.py b/modules/stock_shipment_customs/setup.py deleted file mode 100755 index 1f012f197d..0000000000 --- a/modules/stock_shipment_customs/setup.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_shipment_customs' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for international shipping', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-stock-shipment-customs'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock shipment customs international invoice', - package_dir={'trytond.modules.stock_shipment_customs': '.'}, - packages=( - ['trytond.modules.stock_shipment_customs'] - + ['trytond.modules.stock_shipment_customs.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_shipment_customs': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.8', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_shipment_customs = trytond.modules.stock_shipment_customs - """, # noqa: E501 - ) diff --git a/modules/stock_shipment_customs/tox.ini b/modules/stock_shipment_customs/tox.ini index 53e3ce4cf0..2bfb46e0cd 100644 --- a/modules/stock_shipment_customs/tox.ini +++ b/modules/stock_shipment_customs/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_shipment_customs --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_shipment_customs {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_shipment_measurements/COPYRIGHT b/modules/stock_shipment_measurements/COPYRIGHT index 9512eceaed..6f3a8ebb90 100644 --- a/modules/stock_shipment_measurements/COPYRIGHT +++ b/modules/stock_shipment_measurements/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2017-2025 Cédric Krier -Copyright (C) 2017-2025 B2CK +Copyright (C) 2017-2025 Cédric Krier +Copyright (C) 2017-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_shipment_measurements/MANIFEST.in b/modules/stock_shipment_measurements/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_shipment_measurements/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_shipment_measurements/doc/conf.py b/modules/stock_shipment_measurements/doc/conf.py index e0095e7278..133baaa765 100644 --- a/modules/stock_shipment_measurements/doc/conf.py +++ b/modules/stock_shipment_measurements/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_shipment_measurements/doc/requirements-doc.txt b/modules/stock_shipment_measurements/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_shipment_measurements/doc/requirements-doc.txt +++ b/modules/stock_shipment_measurements/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_shipment_measurements/pyproject.toml b/modules/stock_shipment_measurements/pyproject.toml new file mode 100644 index 0000000000..6e01e5a092 --- /dev/null +++ b/modules/stock_shipment_measurements/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_shipment_measurements' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shipment measurements for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_shipment_measurements = 'trytond.modules.stock_shipment_measurements' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-shipment-measurements/" +changelog = "https://docs.tryton.org/modules-stock-shipment-measurements/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_shipment_measurements" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/stock_shipment_measurements/setup.py b/modules/stock_shipment_measurements/setup.py deleted file mode 100755 index 96cc71fa20..0000000000 --- a/modules/stock_shipment_measurements/setup.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_shipment_measurements' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('trytond_stock_package')] - -setup(name=name, - version=version, - description='Tryton module to add measurements to shipment', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock shipment measurement', - package_dir={'trytond.modules.stock_shipment_measurements': '.'}, - packages=( - ['trytond.modules.stock_shipment_measurements'] - + ['trytond.modules.stock_shipment_measurements.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_shipment_measurements': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_shipment_measurements = trytond.modules.stock_shipment_measurements - """, - ) diff --git a/modules/stock_shipment_measurements/tox.ini b/modules/stock_shipment_measurements/tox.ini index 53e3ce4cf0..cae07e93f6 100644 --- a/modules/stock_shipment_measurements/tox.ini +++ b/modules/stock_shipment_measurements/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_shipment_measurements --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_shipment_measurements {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_shipping_point/COPYRIGHT b/modules/stock_shipping_point/COPYRIGHT index 604a57bdc6..835fb414bd 100644 --- a/modules/stock_shipping_point/COPYRIGHT +++ b/modules/stock_shipping_point/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2025 B2CK -Copyright (C) 2025 Cédric Krier +Copyright (C) 2025 B2CK SRL +Copyright (C) 2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_shipping_point/MANIFEST.in b/modules/stock_shipping_point/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_shipping_point/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_shipping_point/doc/conf.py b/modules/stock_shipping_point/doc/conf.py index c14ebbc284..6682f26fe6 100644 --- a/modules/stock_shipping_point/doc/conf.py +++ b/modules/stock_shipping_point/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_shipping_point/doc/requirements-doc.txt b/modules/stock_shipping_point/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_shipping_point/doc/requirements-doc.txt +++ b/modules/stock_shipping_point/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_shipping_point/pyproject.toml b/modules/stock_shipping_point/pyproject.toml new file mode 100644 index 0000000000..9967a88a4d --- /dev/null +++ b/modules/stock_shipping_point/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_shipping_point' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shipping points for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_shipping_point = 'trytond.modules.stock_shipping_point' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-shipping-point/" +changelog = "https://docs.tryton.org/modules-stock-shipping-point/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_shipping_point" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_product_classification_taxonomic', + ] diff --git a/modules/stock_shipping_point/setup.py b/modules/stock_shipping_point/setup.py deleted file mode 100755 index 52b48833e5..0000000000 --- a/modules/stock_shipping_point/setup.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_shipping_point' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_product_classification'), - get_require_version('trytond_product_classification_taxonomic'), - get_require_version('trytond_stock_shipment_measurements'), - ] - -setup(name=name, - version=version, - description='Tryton module to set shipping point to shipment', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/modules-stock-shipping-point'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock shipping point', - package_dir={'trytond.modules.stock_shipping_point': '.'}, - packages=( - ['trytond.modules.stock_shipping_point'] - + ['trytond.modules.stock_shipping_point.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_shipping_point': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_shipping_point = trytond.modules.stock_shipping_point - """, # noqa: E501 - ) diff --git a/modules/stock_shipping_point/tox.ini b/modules/stock_shipping_point/tox.ini index 53e3ce4cf0..f818a26f70 100644 --- a/modules/stock_shipping_point/tox.ini +++ b/modules/stock_shipping_point/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_shipping_point --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_shipping_point {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_split/COPYRIGHT b/modules/stock_split/COPYRIGHT index 455be7decc..2694803af1 100644 --- a/modules/stock_split/COPYRIGHT +++ b/modules/stock_split/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2012-2025 Cédric Krier. -Copyright (C) 2012-2025 B2CK SPRL. +Copyright (C) 2012-2025 Cédric Krier +Copyright (C) 2012-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_split/MANIFEST.in b/modules/stock_split/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_split/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_split/doc/conf.py b/modules/stock_split/doc/conf.py index 5f60db7bbf..b195cfaae8 100644 --- a/modules/stock_split/doc/conf.py +++ b/modules/stock_split/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_split/doc/requirements-doc.txt b/modules/stock_split/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_split/doc/requirements-doc.txt +++ b/modules/stock_split/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_split/pyproject.toml b/modules/stock_split/pyproject.toml new file mode 100644 index 0000000000..9210c77e5d --- /dev/null +++ b/modules/stock_split/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_split' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Stock moves and shipments splitting for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_split = 'trytond.modules.stock_split' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-split/" +changelog = "https://docs.tryton.org/modules-stock-split/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_split" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_split/setup.py b/modules/stock_split/setup.py deleted file mode 100755 index 67c1bc102a..0000000000 --- a/modules/stock_split/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_split' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to split stock move', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/modules-stock-split/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock split', - package_dir={'trytond.modules.stock_split': '.'}, - packages=( - ['trytond.modules.stock_split'] - + ['trytond.modules.stock_split.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_split': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_split = trytond.modules.stock_split - """, - ) diff --git a/modules/stock_split/tox.ini b/modules/stock_split/tox.ini index 53e3ce4cf0..a6ed0c406f 100644 --- a/modules/stock_split/tox.ini +++ b/modules/stock_split/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_split --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_split {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_supply/COPYRIGHT b/modules/stock_supply/COPYRIGHT index f3c0fbdaf3..923ff34fea 100644 --- a/modules/stock_supply/COPYRIGHT +++ b/modules/stock_supply/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2013-2019 NaN-tic. -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2013-2019 NaN-tic +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_supply/MANIFEST.in b/modules/stock_supply/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_supply/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_supply/doc/conf.py b/modules/stock_supply/doc/conf.py index 86d68e2fa9..85045e3a4a 100644 --- a/modules/stock_supply/doc/conf.py +++ b/modules/stock_supply/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_supply/doc/requirements-doc.txt b/modules/stock_supply/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_supply/doc/requirements-doc.txt +++ b/modules/stock_supply/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_supply/pyproject.toml b/modules/stock_supply/pyproject.toml new file mode 100644 index 0000000000..b4f84da6ab --- /dev/null +++ b/modules/stock_supply/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_supply' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Supply stock for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_supply = 'trytond.modules.stock_supply' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-supply/" +changelog = "https://docs.tryton.org/modules-stock-supply/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_supply" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_supply/setup.py b/modules/stock_supply/setup.py deleted file mode 100755 index 28d09227e0..0000000000 --- a/modules/stock_supply/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_supply' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for stock supply', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock supply', - package_dir={'trytond.modules.stock_supply': '.'}, - packages=( - ['trytond.modules.stock_supply'] - + ['trytond.modules.stock_supply.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_supply': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst', - 'tests/*.json']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_supply = trytond.modules.stock_supply - """, - ) diff --git a/modules/stock_supply/tox.ini b/modules/stock_supply/tox.ini index 53e3ce4cf0..c67e9b9171 100644 --- a/modules/stock_supply/tox.ini +++ b/modules/stock_supply/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_supply --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_supply {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_supply_day/COPYRIGHT b/modules/stock_supply_day/COPYRIGHT index f9702c30ca..bfecfa3ea1 100644 --- a/modules/stock_supply_day/COPYRIGHT +++ b/modules/stock_supply_day/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2012 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2012 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_supply_day/MANIFEST.in b/modules/stock_supply_day/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_supply_day/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_supply_day/doc/conf.py b/modules/stock_supply_day/doc/conf.py index 8baeb8c5b1..d2319d4afa 100644 --- a/modules/stock_supply_day/doc/conf.py +++ b/modules/stock_supply_day/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_supply_day/doc/requirements-doc.txt b/modules/stock_supply_day/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_supply_day/doc/requirements-doc.txt +++ b/modules/stock_supply_day/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_supply_day/pyproject.toml b/modules/stock_supply_day/pyproject.toml new file mode 100644 index 0000000000..b43178e2d4 --- /dev/null +++ b/modules/stock_supply_day/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_supply_day' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Supply stock on weekdays for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_supply_day = 'trytond.modules.stock_supply_day' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-supply-day/" +changelog = "https://docs.tryton.org/modules-stock-supply-day/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_supply_day" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/stock_supply_day/setup.py b/modules/stock_supply_day/setup.py deleted file mode 100755 index 64ebeb6a8e..0000000000 --- a/modules/stock_supply_day/setup.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_supply_day' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to add supply weekdays', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton supply day', - package_dir={'trytond.modules.stock_supply_day': '.'}, - packages=( - ['trytond.modules.stock_supply_day'] - + ['trytond.modules.stock_supply_day.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_supply_day': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_supply_day = trytond.modules.stock_supply_day - """, - ) diff --git a/modules/stock_supply_day/tox.ini b/modules/stock_supply_day/tox.ini index 53e3ce4cf0..64f3ca3a7b 100644 --- a/modules/stock_supply_day/tox.ini +++ b/modules/stock_supply_day/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_supply_day --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_supply_day {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_supply_forecast/COPYRIGHT b/modules/stock_supply_forecast/COPYRIGHT index d61e4ef396..10c8c55375 100644 --- a/modules/stock_supply_forecast/COPYRIGHT +++ b/modules/stock_supply_forecast/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2011-2025 Cédric Krier. -Copyright (C) 2011-2025 B2CK SPRL. +Copyright (C) 2011-2025 Cédric Krier +Copyright (C) 2011-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_supply_forecast/MANIFEST.in b/modules/stock_supply_forecast/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_supply_forecast/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_supply_forecast/doc/conf.py b/modules/stock_supply_forecast/doc/conf.py index 47520181ab..4b870830a5 100644 --- a/modules/stock_supply_forecast/doc/conf.py +++ b/modules/stock_supply_forecast/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_supply_forecast/doc/requirements-doc.txt b/modules/stock_supply_forecast/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_supply_forecast/doc/requirements-doc.txt +++ b/modules/stock_supply_forecast/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_supply_forecast/pyproject.toml b/modules/stock_supply_forecast/pyproject.toml new file mode 100644 index 0000000000..c8b0695a92 --- /dev/null +++ b/modules/stock_supply_forecast/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_supply_forecast' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Supply stock based on forecasts for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_supply_forecast = 'trytond.modules.stock_supply_forecast' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-supply-forecast/" +changelog = "https://docs.tryton.org/modules-stock-supply-forecast/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_supply_forecast" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_supply_forecast/setup.py b/modules/stock_supply_forecast/setup.py deleted file mode 100755 index 7b10e5bfd3..0000000000 --- a/modules/stock_supply_forecast/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_supply_forecast' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to add forecast to supply computation', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock supply forecast', - package_dir={'trytond.modules.stock_supply_forecast': '.'}, - packages=( - ['trytond.modules.stock_supply_forecast'] - + ['trytond.modules.stock_supply_forecast.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_supply_forecast': (info.get('xml', []) - + ['tryton.cfg', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_supply_forecast = trytond.modules.stock_supply_forecast - """, - ) diff --git a/modules/stock_supply_forecast/tox.ini b/modules/stock_supply_forecast/tox.ini index 53e3ce4cf0..eb013a1c82 100644 --- a/modules/stock_supply_forecast/tox.ini +++ b/modules/stock_supply_forecast/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_supply_forecast --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_supply_forecast {posargs} commands_post = coverage report coverage xml diff --git a/modules/stock_supply_production/COPYRIGHT b/modules/stock_supply_production/COPYRIGHT index 455be7decc..2694803af1 100644 --- a/modules/stock_supply_production/COPYRIGHT +++ b/modules/stock_supply_production/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2012-2025 Cédric Krier. -Copyright (C) 2012-2025 B2CK SPRL. +Copyright (C) 2012-2025 Cédric Krier +Copyright (C) 2012-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/stock_supply_production/MANIFEST.in b/modules/stock_supply_production/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/stock_supply_production/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/stock_supply_production/doc/conf.py b/modules/stock_supply_production/doc/conf.py index c424a2a13a..6e281e4efe 100644 --- a/modules/stock_supply_production/doc/conf.py +++ b/modules/stock_supply_production/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/stock_supply_production/doc/requirements-doc.txt b/modules/stock_supply_production/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/stock_supply_production/doc/requirements-doc.txt +++ b/modules/stock_supply_production/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/stock_supply_production/pyproject.toml b/modules/stock_supply_production/pyproject.toml new file mode 100644 index 0000000000..e8d7faf37e --- /dev/null +++ b/modules/stock_supply_production/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_stock_supply_production' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Supply stock with productions for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "stock", "production"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +stock_supply_production = 'trytond.modules.stock_supply_production' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-stock-supply-production/" +changelog = "https://docs.tryton.org/modules-stock-supply-production/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/stock_supply_production" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/stock_supply_production/setup.py b/modules/stock_supply_production/setup.py deleted file mode 100755 index cd99ffe1fe..0000000000 --- a/modules/stock_supply_production/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_stock_supply_production' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module for stock supply of production', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton stock supply production', - package_dir={'trytond.modules.stock_supply_production': '.'}, - packages=( - ['trytond.modules.stock_supply_production'] - + ['trytond.modules.stock_supply_production.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.stock_supply_production': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - stock_supply_production = trytond.modules.stock_supply_production - """, - ) diff --git a/modules/stock_supply_production/tox.ini b/modules/stock_supply_production/tox.ini index 53e3ce4cf0..e639658d79 100644 --- a/modules/stock_supply_production/tox.ini +++ b/modules/stock_supply_production/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.stock_supply_production --omit=*/tests/* -m xmlrunner discover -s trytond.modules.stock_supply_production {posargs} commands_post = coverage report coverage xml diff --git a/modules/timesheet/COPYRIGHT b/modules/timesheet/COPYRIGHT index a392859693..dc839cb31b 100644 --- a/modules/timesheet/COPYRIGHT +++ b/modules/timesheet/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/timesheet/MANIFEST.in b/modules/timesheet/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/timesheet/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/timesheet/doc/conf.py b/modules/timesheet/doc/conf.py index cf291d3841..c8250518ec 100644 --- a/modules/timesheet/doc/conf.py +++ b/modules/timesheet/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/timesheet/doc/requirements-doc.txt b/modules/timesheet/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/timesheet/doc/requirements-doc.txt +++ b/modules/timesheet/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/timesheet/pyproject.toml b/modules/timesheet/pyproject.toml new file mode 100644 index 0000000000..cb787767bd --- /dev/null +++ b/modules/timesheet/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_timesheet' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Timesheets for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "timesheet"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +timesheet = 'trytond.modules.timesheet' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-timesheet/" +changelog = "https://docs.tryton.org/modules-timesheet/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/timesheet" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/timesheet/setup.py b/modules/timesheet/setup.py deleted file mode 100755 index b27182594b..0000000000 --- a/modules/timesheet/setup.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - if slice: - content = '\n'.join(content.splitlines()[slice]) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_timesheet' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module with timesheets', - long_description=read('README.rst', slice=slice(0, -5)), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton timesheet', - package_dir={'trytond.modules.timesheet': '.'}, - packages=( - ['trytond.modules.timesheet'] - + ['trytond.modules.timesheet.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.timesheet': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - timesheet = trytond.modules.timesheet - """, - ) diff --git a/modules/timesheet/tox.ini b/modules/timesheet/tox.ini index 53e3ce4cf0..a9738e0e78 100644 --- a/modules/timesheet/tox.ini +++ b/modules/timesheet/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.timesheet --omit=*/tests/* -m xmlrunner discover -s trytond.modules.timesheet {posargs} commands_post = coverage report coverage xml diff --git a/modules/timesheet_cost/COPYRIGHT b/modules/timesheet_cost/COPYRIGHT index 8077ed4a15..a1de6d1e27 100644 --- a/modules/timesheet_cost/COPYRIGHT +++ b/modules/timesheet_cost/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2008-2025 Cédric Krier. -Copyright (C) 2008-2025 B2CK SPRL. +Copyright (C) 2008-2025 Cédric Krier +Copyright (C) 2008-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/timesheet_cost/MANIFEST.in b/modules/timesheet_cost/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/timesheet_cost/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/timesheet_cost/doc/conf.py b/modules/timesheet_cost/doc/conf.py index f136e80f3b..3bdb8796b9 100644 --- a/modules/timesheet_cost/doc/conf.py +++ b/modules/timesheet_cost/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/timesheet_cost/doc/requirements-doc.txt b/modules/timesheet_cost/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/timesheet_cost/doc/requirements-doc.txt +++ b/modules/timesheet_cost/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/timesheet_cost/pyproject.toml b/modules/timesheet_cost/pyproject.toml new file mode 100644 index 0000000000..7162aea111 --- /dev/null +++ b/modules/timesheet_cost/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_timesheet_cost' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Timesheet costs for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "timesheet"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +timesheet_cost = 'trytond.modules.timesheet_cost' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-timesheet-cost/" +changelog = "https://docs.tryton.org/modules-timesheet-cost/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/timesheet_cost" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql >= 0.4'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/timesheet_cost/setup.py b/modules/timesheet_cost/setup.py deleted file mode 100755 index 6726c17a1b..0000000000 --- a/modules/timesheet_cost/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_timesheet_cost' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql >= 0.4'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to add cost on timesheet', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton timesheet cost', - package_dir={'trytond.modules.timesheet_cost': '.'}, - packages=( - ['trytond.modules.timesheet_cost'] - + ['trytond.modules.timesheet_cost.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.timesheet_cost': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - timesheet_cost = trytond.modules.timesheet_cost - """, - ) diff --git a/modules/timesheet_cost/tox.ini b/modules/timesheet_cost/tox.ini index 53e3ce4cf0..c3a8fe35b2 100644 --- a/modules/timesheet_cost/tox.ini +++ b/modules/timesheet_cost/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.timesheet_cost --omit=*/tests/* -m xmlrunner discover -s trytond.modules.timesheet_cost {posargs} commands_post = coverage report coverage xml diff --git a/modules/user_role/COPYRIGHT b/modules/user_role/COPYRIGHT index 0389249205..7fe447c110 100644 --- a/modules/user_role/COPYRIGHT +++ b/modules/user_role/COPYRIGHT @@ -1,4 +1,5 @@ -Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 Cédric Krier +Copyright (C) 2018-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/user_role/doc/conf.py b/modules/user_role/doc/conf.py index 79c1f2412e..6271259aac 100644 --- a/modules/user_role/doc/conf.py +++ b/modules/user_role/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/user_role/doc/requirements-doc.txt b/modules/user_role/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/user_role/doc/requirements-doc.txt +++ b/modules/user_role/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/user_role/pyproject.toml b/modules/user_role/pyproject.toml new file mode 100644 index 0000000000..7302864217 --- /dev/null +++ b/modules/user_role/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_user_role' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "User roles for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "user"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +user_role = 'trytond.modules.user_role' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-user-role/" +changelog = "https://docs.tryton.org/modules-user-role/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/user_role" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/user_role/setup.py b/modules/user_role/setup.py deleted file mode 100755 index a3674200a4..0000000000 --- a/modules/user_role/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_user_role' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [get_require_version('proteus')] - -setup(name=name, - version=version, - description='Tryton module to manage role on user', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='user role group access', - package_dir={'trytond.modules.user_role': '.'}, - packages=( - ['trytond.modules.user_role'] - + ['trytond.modules.user_role.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.user_role': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - user_role = trytond.modules.user_role - """, - ) diff --git a/modules/user_role/tox.ini b/modules/user_role/tox.ini index 53e3ce4cf0..e1b09c0c6b 100644 --- a/modules/user_role/tox.ini +++ b/modules/user_role/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.user_role --omit=*/tests/* -m xmlrunner discover -s trytond.modules.user_role {posargs} commands_post = coverage report coverage xml diff --git a/modules/web_shop/COPYRIGHT b/modules/web_shop/COPYRIGHT index 98cf5e2d52..83cca03ba3 100644 --- a/modules/web_shop/COPYRIGHT +++ b/modules/web_shop/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2020-2025 Cédric Krier -Copyright (C) 2020-2025 B2CK +Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/web_shop/MANIFEST.in b/modules/web_shop/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/web_shop/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/web_shop/doc/conf.py b/modules/web_shop/doc/conf.py index 19175c570b..e802199dca 100644 --- a/modules/web_shop/doc/conf.py +++ b/modules/web_shop/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/web_shop/doc/requirements-doc.txt b/modules/web_shop/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/web_shop/doc/requirements-doc.txt +++ b/modules/web_shop/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/web_shop/pyproject.toml b/modules/web_shop/pyproject.toml new file mode 100644 index 0000000000..76117c21d7 --- /dev/null +++ b/modules/web_shop/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_web_shop' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Webshops for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "webshop"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +web_shop = 'trytond.modules.web_shop' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-web-shop/" +changelog = "https://docs.tryton.org/modules-web-shop/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/web_shop" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/web_shop/setup.py b/modules/web_shop/setup.py deleted file mode 100755 index cd1d3f56c2..0000000000 --- a/modules/web_shop/setup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - if slice: - content = '\n'.join(content.splitlines()[slice]) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_web_shop' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('trytond_account_tax_rule_country'), - get_require_version('trytond_product_attribute'), - get_require_version('trytond_product_image'), - get_require_version('trytond_sale_price_list'), - ] - -setup(name=name, - version=version, - description='Tryton module that provides a common base for webshops', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='webshop ecommerce', - package_dir={'trytond.modules.web_shop': '.'}, - packages=( - ['trytond.modules.web_shop'] - + ['trytond.modules.web_shop.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.web_shop': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - web_shop = trytond.modules.web_shop - """, - ) diff --git a/modules/web_shop/tox.ini b/modules/web_shop/tox.ini index 53e3ce4cf0..1da6841577 100644 --- a/modules/web_shop/tox.ini +++ b/modules/web_shop/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.web_shop --omit=*/tests/* -m xmlrunner discover -s trytond.modules.web_shop {posargs} commands_post = coverage report coverage xml diff --git a/modules/web_shop_product_data_feed/COPYRIGHT b/modules/web_shop_product_data_feed/COPYRIGHT index b597fcb534..0501781531 100644 --- a/modules/web_shop_product_data_feed/COPYRIGHT +++ b/modules/web_shop_product_data_feed/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2024-2025 B2CK -Copyright (C) 2024-2025 Cédric Krier +Copyright (C) 2024-2025 B2CK SRL +Copyright (C) 2024-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/web_shop_product_data_feed/MANIFEST.in b/modules/web_shop_product_data_feed/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/web_shop_product_data_feed/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/web_shop_product_data_feed/doc/conf.py b/modules/web_shop_product_data_feed/doc/conf.py index 5bc3ebfc9a..39c1fa8724 100644 --- a/modules/web_shop_product_data_feed/doc/conf.py +++ b/modules/web_shop_product_data_feed/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/web_shop_product_data_feed/doc/requirements-doc.txt b/modules/web_shop_product_data_feed/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/web_shop_product_data_feed/doc/requirements-doc.txt +++ b/modules/web_shop_product_data_feed/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/web_shop_product_data_feed/pyproject.toml b/modules/web_shop_product_data_feed/pyproject.toml new file mode 100644 index 0000000000..6acd7dd2f4 --- /dev/null +++ b/modules/web_shop_product_data_feed/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_web_shop_product_data_feed' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Web shop data feed for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "webshop"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +web_shop_product_data_feed = 'trytond.modules.web_shop_product_data_feed' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-web-shop-product-data-feed/" +changelog = "https://docs.tryton.org/modules-web-shop-product-data-feed/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + 'tests/**/*.csv', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/web_shop_product_data_feed" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/web_shop_product_data_feed/setup.py b/modules/web_shop_product_data_feed/setup.py deleted file mode 100755 index a55922903c..0000000000 --- a/modules/web_shop_product_data_feed/setup.py +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_web_shop_product_data_feed' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('trytond_account_tax_rule_country'), - get_require_version('trytond_product_image'), - get_require_version('trytond_product_kit'), - get_require_version('trytond_product_measurements'), - get_require_version('trytond_sale_shipment_cost'), - ] - -setup(name=name, - version=version, - description='Tryton module to expose product data feed', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/latest/' - 'modules-web-shop-product-data-feed'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='webshop ecommerce product feed', - package_dir={'trytond.modules.web_shop_product_data_feed': '.'}, - packages=( - ['trytond.modules.web_shop_product_data_feed'] - + ['trytond.modules.web_shop_product_data_feed.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.web_shop_product_data_feed': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst', 'tests/*.json', 'tests/*.csv']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - web_shop_product_data_feed = trytond.modules.web_shop_product_data_feed - """, # noqa: E501 - ) diff --git a/modules/web_shop_product_data_feed/tox.ini b/modules/web_shop_product_data_feed/tox.ini index 53e3ce4cf0..7c3f199fb4 100644 --- a/modules/web_shop_product_data_feed/tox.ini +++ b/modules/web_shop_product_data_feed/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.web_shop_product_data_feed --omit=*/tests/* -m xmlrunner discover -s trytond.modules.web_shop_product_data_feed {posargs} commands_post = coverage report coverage xml diff --git a/modules/web_shop_shopify/COPYRIGHT b/modules/web_shop_shopify/COPYRIGHT index 523289548e..202b682dd7 100644 --- a/modules/web_shop_shopify/COPYRIGHT +++ b/modules/web_shop_shopify/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2021-2025 B2CK -Copyright (C) 2021-2025 Cédric Krier +Copyright (C) 2021-2025 B2CK SRL +Copyright (C) 2021-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/web_shop_shopify/MANIFEST.in b/modules/web_shop_shopify/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/web_shop_shopify/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/web_shop_shopify/doc/conf.py b/modules/web_shop_shopify/doc/conf.py index 1960738265..9ee4adc74a 100644 --- a/modules/web_shop_shopify/doc/conf.py +++ b/modules/web_shop_shopify/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/web_shop_shopify/doc/requirements-doc.txt b/modules/web_shop_shopify/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/web_shop_shopify/doc/requirements-doc.txt +++ b/modules/web_shop_shopify/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/web_shop_shopify/pyproject.toml b/modules/web_shop_shopify/pyproject.toml new file mode 100644 index 0000000000..fa13fd1689 --- /dev/null +++ b/modules/web_shop_shopify/pyproject.toml @@ -0,0 +1,68 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_web_shop_shopify' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Shopify integration with Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "webshop"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +web_shop_shopify = 'trytond.modules.web_shop_shopify' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-web-shop-shopify/" +changelog = "https://docs.tryton.org/modules-web-shop-shopify/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/web_shop_shopify" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'ShopifyAPI', + 'pyactiveresource', + 'python-dateutil', + 'python-sql', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [ + 'proteus', + 'trytond_account_payment_clearing', + 'trytond_party[phonenumbers]', + ] diff --git a/modules/web_shop_shopify/setup.py b/modules/web_shop_shopify/setup.py deleted file mode 100755 index 2c60066965..0000000000 --- a/modules/web_shop_shopify/setup.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_web_shop_shopify' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['ShopifyAPI', 'pyactiveresource', 'python-sql', 'python-dateutil'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_account_payment_clearing'), - get_require_version('trytond_carrier'), - get_require_version('trytond_customs'), - get_require_version('trytond_product_image'), - get_require_version('trytond_product_image_attribute'), - get_require_version('trytond_product_kit'), - get_require_version('trytond_product_measurements'), - get_require_version('trytond_sale_discount'), - get_require_version('trytond_sale_invoice_grouping'), - get_require_version('trytond_sale_secondary_unit'), - get_require_version('trytond_sale_shipment_cost'), - get_require_version('trytond_stock_package_shipping'), - get_require_version('trytond_party[phonenumbers]'), - ] - -setup(name=name, - version=version, - description='Module to integrate Tryton with Shopify', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/modules-web-shop-shopify'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='web shopify ecommerce', - package_dir={'trytond.modules.web_shop_shopify': '.'}, - packages=( - ['trytond.modules.web_shop_shopify'] - + ['trytond.modules.web_shop_shopify.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.web_shop_shopify': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - web_shop_shopify = trytond.modules.web_shop_shopify - """, # noqa: E501 - ) diff --git a/modules/web_shop_shopify/tox.ini b/modules/web_shop_shopify/tox.ini index 53e3ce4cf0..ee12c6bbe4 100644 --- a/modules/web_shop_shopify/tox.ini +++ b/modules/web_shop_shopify/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.web_shop_shopify --omit=*/tests/* -m xmlrunner discover -s trytond.modules.web_shop_shopify {posargs} commands_post = coverage report coverage xml diff --git a/modules/web_shop_vue_storefront/COPYRIGHT b/modules/web_shop_vue_storefront/COPYRIGHT index f85dc624b4..01cea9b9c1 100644 --- a/modules/web_shop_vue_storefront/COPYRIGHT +++ b/modules/web_shop_vue_storefront/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2020-2025 B2CK -Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL +Copyright (C) 2020-2025 Cédric Krier This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/web_shop_vue_storefront/MANIFEST.in b/modules/web_shop_vue_storefront/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/web_shop_vue_storefront/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/web_shop_vue_storefront/doc/conf.py b/modules/web_shop_vue_storefront/doc/conf.py index bb67d0ecb1..daa1a80584 100644 --- a/modules/web_shop_vue_storefront/doc/conf.py +++ b/modules/web_shop_vue_storefront/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/web_shop_vue_storefront/doc/requirements-doc.txt b/modules/web_shop_vue_storefront/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/web_shop_vue_storefront/doc/requirements-doc.txt +++ b/modules/web_shop_vue_storefront/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/web_shop_vue_storefront/pyproject.toml b/modules/web_shop_vue_storefront/pyproject.toml new file mode 100644 index 0000000000..bee39d1cd1 --- /dev/null +++ b/modules/web_shop_vue_storefront/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_web_shop_vue_storefront' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Vue Storefront integration with Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "webshop"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +web_shop_vue_storefront = 'trytond.modules.web_shop_vue_storefront' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-web-shop-vue-storefront/" +changelog = "https://docs.tryton.org/modules-web-shop-vue-storefront/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/web_shop_vue_storefront" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'elasticsearch', + 'python-stdnum >= 1.1.0', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['proteus'] diff --git a/modules/web_shop_vue_storefront/setup.py b/modules/web_shop_vue_storefront/setup.py deleted file mode 100755 index 282d07cf3f..0000000000 --- a/modules/web_shop_vue_storefront/setup.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - if slice: - content = '\n'.join(content.splitlines()[slice]) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_web_shop_vue_storefront' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['elasticsearch', 'python-stdnum >= 1.1.0'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [ - get_require_version('proteus'), - get_require_version('trytond_product_attribute'), - get_require_version('trytond_product_image'), - get_require_version('trytond_sale_promotion_coupon'), - get_require_version('trytond_sale_shipment_cost'), - get_require_version('trytond_carrier'), - ] - -setup(name=name, - version=version, - description='Tryton module to integrate with Vue Storefront', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='web vue storefront PWA ecommerce', - package_dir={'trytond.modules.web_shop_vue_storefront': '.'}, - packages=( - ['trytond.modules.web_shop_vue_storefront'] - + ['trytond.modules.web_shop_vue_storefront.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.web_shop_vue_storefront': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - web_shop_vue_storefront = trytond.modules.web_shop_vue_storefront - """, - ) diff --git a/modules/web_shop_vue_storefront/tox.ini b/modules/web_shop_vue_storefront/tox.ini index 53e3ce4cf0..2d4e741737 100644 --- a/modules/web_shop_vue_storefront/tox.ini +++ b/modules/web_shop_vue_storefront/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.web_shop_vue_storefront --omit=*/tests/* -m xmlrunner discover -s trytond.modules.web_shop_vue_storefront {posargs} commands_post = coverage report coverage xml diff --git a/modules/web_shop_vue_storefront_stripe/COPYRIGHT b/modules/web_shop_vue_storefront_stripe/COPYRIGHT index 98cf5e2d52..83cca03ba3 100644 --- a/modules/web_shop_vue_storefront_stripe/COPYRIGHT +++ b/modules/web_shop_vue_storefront_stripe/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2020-2025 Cédric Krier -Copyright (C) 2020-2025 B2CK +Copyright (C) 2020-2025 Cédric Krier +Copyright (C) 2020-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/web_shop_vue_storefront_stripe/MANIFEST.in b/modules/web_shop_vue_storefront_stripe/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/web_shop_vue_storefront_stripe/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/web_shop_vue_storefront_stripe/doc/conf.py b/modules/web_shop_vue_storefront_stripe/doc/conf.py index 404e9c9801..506e303164 100644 --- a/modules/web_shop_vue_storefront_stripe/doc/conf.py +++ b/modules/web_shop_vue_storefront_stripe/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/web_shop_vue_storefront_stripe/doc/requirements-doc.txt b/modules/web_shop_vue_storefront_stripe/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/web_shop_vue_storefront_stripe/doc/requirements-doc.txt +++ b/modules/web_shop_vue_storefront_stripe/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/web_shop_vue_storefront_stripe/pyproject.toml b/modules/web_shop_vue_storefront_stripe/pyproject.toml new file mode 100644 index 0000000000..8d0ee0f992 --- /dev/null +++ b/modules/web_shop_vue_storefront_stripe/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_web_shop_vue_storefront_stripe' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Vue Storefront integration with Stripe for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "webshop"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +web_shop_vue_storefront_stripe = 'trytond.modules.web_shop_vue_storefront_stripe' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-web-shop-vue-storefront-stripe/" +changelog = "https://docs.tryton.org/modules-web-shop-vue-storefront-stripe/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/web_shop_vue_storefront_stripe" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/web_shop_vue_storefront_stripe/setup.py b/modules/web_shop_vue_storefront_stripe/setup.py deleted file mode 100755 index 4900659e6d..0000000000 --- a/modules/web_shop_vue_storefront_stripe/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname, slice=None): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - if slice: - content = '\n'.join(content.splitlines()[slice]) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_web_shop_vue_storefront_stripe' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to support Stripe payment with Vue Storefront', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='web vue storefront PWA ecommerce Stripe', - package_dir={'trytond.modules.web_shop_vue_storefront_stripe': '.'}, - packages=( - ['trytond.modules.web_shop_vue_storefront_stripe'] - + ['trytond.modules.web_shop_vue_storefront_stripe.%s' % p - for p in find_packages()] - ), - package_data={ - 'trytond.modules.web_shop_vue_storefront_stripe': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - web_shop_vue_storefront_stripe = trytond.modules.web_shop_vue_storefront_stripe - """, # noqa: E501 - ) diff --git a/modules/web_shop_vue_storefront_stripe/tox.ini b/modules/web_shop_vue_storefront_stripe/tox.ini index 53e3ce4cf0..46d9404092 100644 --- a/modules/web_shop_vue_storefront_stripe/tox.ini +++ b/modules/web_shop_vue_storefront_stripe/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.web_shop_vue_storefront_stripe --omit=*/tests/* -m xmlrunner discover -s trytond.modules.web_shop_vue_storefront_stripe {posargs} commands_post = coverage report coverage xml diff --git a/modules/web_shortener/COPYRIGHT b/modules/web_shortener/COPYRIGHT index 3ccae1c25f..ac50eaca89 100644 --- a/modules/web_shortener/COPYRIGHT +++ b/modules/web_shortener/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2018-2025 B2CK -Copyright (C) 2019-2025 Cédric Krier -Copyright (C) 2018-2019 Nicolas Êvrard +Copyright (C) 2018-2025 B2CK SRL +Copyright (C) 2019-2025 Cédric Krier +Copyright (C) 2018-2019 Nicolas Êvrard This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/web_shortener/MANIFEST.in b/modules/web_shortener/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/web_shortener/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/web_shortener/doc/conf.py b/modules/web_shortener/doc/conf.py index 4db02bcb71..c8a93000b8 100644 --- a/modules/web_shortener/doc/conf.py +++ b/modules/web_shortener/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/web_shortener/doc/requirements-doc.txt b/modules/web_shortener/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/web_shortener/doc/requirements-doc.txt +++ b/modules/web_shortener/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/web_shortener/pyproject.toml b/modules/web_shortener/pyproject.toml new file mode 100644 index 0000000000..4b3589a76e --- /dev/null +++ b/modules/web_shortener/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_web_shortener' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "URL shortener for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +web_shortener = 'trytond.modules.web_shortener' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-web-shortener/" +changelog = "https://docs.tryton.org/modules-web-shortener/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/web_shortener" + +[tool.hatch.metadata.hooks.tryton] +dependencies = ['python-sql'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/web_shortener/setup.py b/modules/web_shortener/setup.py deleted file mode 100755 index 490a95d95c..0000000000 --- a/modules/web_shortener/setup.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_web_shortener' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['python-sql'] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to plug a URL to an action', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton url', - package_dir={'trytond.modules.web_shortener': '.'}, - packages=( - ['trytond.modules.web_shortener'] - + ['trytond.modules.web_shortener.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.web_shortener': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - web_shortener = trytond.modules.web_shortener - """, - ) diff --git a/modules/web_shortener/tox.ini b/modules/web_shortener/tox.ini index 53e3ce4cf0..17a6dc51eb 100644 --- a/modules/web_shortener/tox.ini +++ b/modules/web_shortener/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.web_shortener --omit=*/tests/* -m xmlrunner discover -s trytond.modules.web_shortener {posargs} commands_post = coverage report coverage xml diff --git a/modules/web_user/COPYRIGHT b/modules/web_user/COPYRIGHT index 5e97b93a9c..20cd6e00b2 100644 --- a/modules/web_user/COPYRIGHT +++ b/modules/web_user/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2016-2025 Cédric Krier -Copyright (C) 2016-2025 B2CK +Copyright (C) 2016-2025 Cédric Krier +Copyright (C) 2016-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/modules/web_user/MANIFEST.in b/modules/web_user/MANIFEST.in deleted file mode 100644 index f7e7aaa36b..0000000000 --- a/modules/web_user/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include icons/LICENSE -graft doc diff --git a/modules/web_user/doc/conf.py b/modules/web_user/doc/conf.py index 0dd1a5602a..30d6fd48c7 100644 --- a/modules/web_user/doc/conf.py +++ b/modules/web_user/doc/conf.py @@ -15,8 +15,8 @@ else: def get_info(): import configparser + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) @@ -24,17 +24,15 @@ def get_info(): config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) info = dict(config.items('tryton')) - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/modules/web_user/doc/requirements-doc.txt b/modules/web_user/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/modules/web_user/doc/requirements-doc.txt +++ b/modules/web_user/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/modules/web_user/pyproject.toml b/modules/web_user/pyproject.toml new file mode 100644 index 0000000000..341276bc19 --- /dev/null +++ b/modules/web_user/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_web_user' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Web users for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'icons/LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "user"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.modules'] +web_user = 'trytond.modules.web_user' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/modules-web-user/" +changelog = "https://docs.tryton.org/modules-web-user/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.build] +include = [ + '**/tryton.cfg', + '**/*.py', + '**/*.xml', + 'view/**/*.xml', + 'locale/**/*.po', + '**/*.fodt', + '**/*.html', + 'icons/**/*.svg', + 'tests/**/*.rst', + 'tests/**/*.json', + ] +exclude = ['doc'] + +[tool.hatch.build.targets.wheel.sources] +"" = "trytond/modules/web_user" + +[tool.hatch.metadata.hooks.tryton] +dependencies = [] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = [] diff --git a/modules/web_user/setup.py b/modules/web_user/setup.py deleted file mode 100755 index 01dd62f941..0000000000 --- a/modules/web_user/setup.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re -from configparser import ConfigParser - -from setuptools import find_packages, setup - - -def read(fname): - content = io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -config = ConfigParser() -config.read_file(open(os.path.join(os.path.dirname(__file__), 'tryton.cfg'))) -info = dict(config.items('tryton')) -for key in ('depends', 'extras_depend', 'xml'): - if key in info: - info[key] = info[key].strip().splitlines() -version = info.get('version', '0.0.1') -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_web_user' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = [] -for dep in info.get('depends', []): - if not re.match(r'(ir|res)(\W|$)', dep): - requires.append(get_require_version('trytond_%s' % dep)) -requires.append(get_require_version('trytond')) - -tests_require = [] - -setup(name=name, - version=version, - description='Tryton module to manage Web users', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": ( - 'https://docs.tryton.org/' - 'modules-web-user'), - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='web user', - package_dir={'trytond.modules.web_user': '.'}, - packages=( - ['trytond.modules.web_user'] - + ['trytond.modules.web_user.%s' % p for p in find_packages()] - ), - package_data={ - 'trytond.modules.web_user': (info.get('xml', []) - + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.html', - 'icons/*.svg', 'tests/*.rst']), - }, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - zip_safe=False, - entry_points=""" - [trytond.modules] - web_user = trytond.modules.web_user - """, - ) diff --git a/modules/web_user/tox.ini b/modules/web_user/tox.ini index 53e3ce4cf0..8e63340c8b 100644 --- a/modules/web_user/tox.ini +++ b/modules/web_user/tox.ini @@ -2,10 +2,10 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tests {posargs} + coverage run --source=trytond.modules.web_user --omit=*/tests/* -m xmlrunner discover -s trytond.modules.web_user {posargs} commands_post = coverage report coverage xml diff --git a/proteus/COPYRIGHT b/proteus/COPYRIGHT index cfbe80e71e..ab084cfc23 100644 --- a/proteus/COPYRIGHT +++ b/proteus/COPYRIGHT @@ -1,5 +1,5 @@ -Copyright (C) 2010-2025 Cédric Krier. -Copyright (C) 2010-2025 B2CK SPRL. +Copyright (C) 2010-2025 Cédric Krier +Copyright (C) 2010-2025 B2CK SRL This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/proteus/MANIFEST.in b/proteus/MANIFEST.in deleted file mode 100644 index 005b0af076..0000000000 --- a/proteus/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -graft doc diff --git a/proteus/doc/conf.py b/proteus/doc/conf.py index 88d2fa2ce1..b8f092c831 100644 --- a/proteus/doc/conf.py +++ b/proteus/doc/conf.py @@ -13,24 +13,22 @@ else: def get_info(): + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) info = dict() - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/proteus/doc/requirements-doc.txt b/proteus/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/proteus/doc/requirements-doc.txt +++ b/proteus/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/proteus/pyproject.toml b/proteus/pyproject.toml new file mode 100644 index 0000000000..0d15414b5e --- /dev/null +++ b/proteus/pyproject.toml @@ -0,0 +1,55 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'proteus' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Client library for Tryton" +license = 'LGPL-3.0-or-later' +license-files = ['LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "cli"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Intended Audience :: Developers", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/client-library/" +changelog = "https://docs.tryton.org/client-library/releases.html" +forum = "https://discuss.tryton.org/tags/proteus" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.version] +path = 'proteus/__init__.py' + +[tool.hatch.build] +packages = ['proteus'] + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'defusedxml', + 'python-dateutil', + ] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +trytond = [ + 'trytond', + ] +test = [ + 'trytond', + 'trytond_party', + ] diff --git a/proteus/setup.py b/proteus/setup.py deleted file mode 100755 index 559f74bea8..0000000000 --- a/proteus/setup.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. -import io -import os -import re - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def readme(): - content = read('README.rst') - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_version(): - init = read(os.path.join('proteus', '__init__.py')) - return re.search('__version__ = "([0-9.]*)"', init).group(1) - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -name = 'proteus' -version = get_version() -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -setup(name=name, - version=version, - description='Library to access Tryton server as a client', - long_description=readme(), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/client-library/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton library cli', - packages=find_packages(), - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'Intended Audience :: Financial and Insurance Industry', - 'Intended Audience :: Legal Industry', - 'License :: OSI Approved :: ' - 'GNU Library or Lesser General Public License (LGPL)', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Office/Business', - ], - platforms='any', - license='LGPL-3', - python_requires='>=3.9', - install_requires=[ - 'defusedxml', - "python-dateutil", - ], - extras_require={ - 'trytond': [get_require_version('trytond')], - 'test': [ - get_require_version('trytond'), - get_require_version('trytond_party'), - ], - }, - zip_safe=True, - ) diff --git a/proteus/tox.ini b/proteus/tox.ini index e863b2a16e..e1ec87d931 100644 --- a/proteus/tox.ini +++ b/proteus/tox.ini @@ -2,10 +2,10 @@ envlist = py39,py310,py311,py312,py313 [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s proteus.tests {posargs} + coverage run --source=proteus --omit=*/tests/* -m xmlrunner discover -s proteus.tests {posargs} commands_post = coverage report coverage xml diff --git a/sao/COPYRIGHT b/sao/COPYRIGHT index 11d230c2ae..81f9ff1cd1 100644 --- a/sao/COPYRIGHT +++ b/sao/COPYRIGHT @@ -1,7 +1,7 @@ -Copyright (C) 2012-2025 Nicolas Évrard. -Copyright (C) 2012-2025 Cédric Krier. -Copyright (C) 2012-2014 Bertrand Chenal. -Copyright (C) 2012-2025 B2CK SPRL. +Copyright (C) 2012-2025 Nicolas Évrard +Copyright (C) 2012-2025 Cédric Krier +Copyright (C) 2012-2014 Bertrand Chenal +Copyright (C) 2012-2025 B2CK SRL. Copyright (C) 2019 Jitbit. Copyright (C) 2013 Thomas Park Copyright (C) 2020-2021 Maxime Richez diff --git a/tryton/COPYRIGHT b/tryton/COPYRIGHT index 36304515d1..b06a3cf02a 100644 --- a/tryton/COPYRIGHT +++ b/tryton/COPYRIGHT @@ -1,13 +1,13 @@ -Copyright (C) 2004-2008 Tiny SPRL. -Copyright (C) 2007-2009 Lorenzo Gil Sanchez. -Copyright (C) 2007-2013 Bertrand Chenal. -Copyright (C) 2007-2025 Cédric Krier. -Copyright (C) 2008-2025 Udo Spallek. -Copyright (C) 2008-2011 virtual things - Preisler & Spallek GbR. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2010-2025 Nicolas Évrard. -Copyright (C) 2011-2012 Rodrigo Hübner. -Copyright (C) 2012-2013 Antoine Smolders. +Copyright (C) 2004-2008 Tiny SPRL +Copyright (C) 2007-2009 Lorenzo Gil Sanchez +Copyright (C) 2007-2013 Bertrand Chenal +Copyright (C) 2007-2025 Cédric Krier +Copyright (C) 2008-2025 Udo Spallek +Copyright (C) 2008-2011 virtual things - Preisler & Spallek GbR +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2010-2025 Nicolas Évrard +Copyright (C) 2011-2012 Rodrigo Hübner +Copyright (C) 2012-2013 Antoine Smolders Copyright (C) 2020-2021 Maxime Richez Copyright (C) 2020-2021 SALUC SA diff --git a/tryton/MANIFEST.in b/tryton/MANIFEST.in deleted file mode 100644 index 0ecb5a68e4..0000000000 --- a/tryton/MANIFEST.in +++ /dev/null @@ -1,15 +0,0 @@ -include LICENSE -include COPYRIGHT -include README.rst -include CHANGELOG -include setup.nsi -include setup-single.nsi -include setup-bundle.sh -include tryton.desktop -include *.nsh -include setup-freeze.py -include make-*-installer.sh -include */gtk-3.0/* -include tryton/data/pixmaps/tryton/LICENSE -include tryton/data/sounds/LICENSE -graft doc diff --git a/tryton/doc/conf.py b/tryton/doc/conf.py index 657c522118..8597d3db1d 100644 --- a/tryton/doc/conf.py +++ b/tryton/doc/conf.py @@ -8,29 +8,27 @@ if base_url: modules_url = base_url + '/modules-{module}/' trytond_url = base_url + '/server/' else: - modules_url = 'https://docs.tryton.org/${series}/modules-{module}/' - trytond_url = 'https://docs.tryton.org/${series}/server/' + modules_url = 'https://docs.tryton.org/{series}/modules-{module}/' + trytond_url = 'https://docs.tryton.org/{series}/server/' def get_info(): + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) info = dict() - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/tryton/doc/requirements-doc.txt b/tryton/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/tryton/doc/requirements-doc.txt +++ b/tryton/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/tryton/hatch_build.py b/tryton/hatch_build.py new file mode 100755 index 0000000000..8b1bb0e563 --- /dev/null +++ b/tryton/hatch_build.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os.path +from pathlib import Path +from typing import Any + +from babel.messages.frontend import CommandLineInterface +from hatchling.builders.hooks.plugin.interface import BuildHookInterface + + +class CustomBuildHook(BuildHookInterface): + + def initialize(self, version: str, build_data: dict[str, Any]) -> None: + compile_translations(self.build_config.root) + + +def compile_translations(root: str) -> None: + locale = Path(root) / 'tryton/data/locale' + CommandLineInterface().run([ + 'pybabel', '-q', 'compile', '-d', locale, '-D', 'tryton']) + + +if __name__ == '__main__': + compile_translations(os.path.dirname(__file__)) diff --git a/tryton/make-darwin-installer.sh b/tryton/make-darwin-installer.sh index 84c4607b64..ddbab299c1 100644 --- a/tryton/make-darwin-installer.sh +++ b/tryton/make-darwin-installer.sh @@ -1,6 +1,6 @@ #!/bin/sh set -e -version=`./setup.py --version` +version=`python -m build -q --metadata 2>/dev/null | jq -r .version` machine=`python3 -c "import platform; print(platform.machine())"` rm -rf build dist mkdir -p darwin/gtk-3.0 @@ -13,7 +13,7 @@ gtk-query-immodules-3.0 \ | sed -e '/^#/d' \ | sed -e 's@/.*/lib/gtk-3.0@\@executable_path/lib/gtk-3.0@' \ > darwin/gtk-3.0/gtk.immodules -./setup.py compile_catalog +python ./hatch_build.py ./setup-freeze.py bdist_mac mkdir dist mv build/Tryton.app dist/ diff --git a/tryton/make-win32-installer.sh b/tryton/make-win32-installer.sh index 218645bf7b..352075f28a 100644 --- a/tryton/make-win32-installer.sh +++ b/tryton/make-win32-installer.sh @@ -1,13 +1,13 @@ #!/bin/sh set -e -version=`./setup.py --version` +version=`python -m build -q --metadata 2>/dev/null | jq -r .version` series=${version%.*} bits=`python -c "import platform; print(platform.architecture()[0])"` rm -rf build dist mkdir -p win32/gtk-3.0 gdk-pixbuf-query-loaders | sed -e '/^#/d' > win32/gtk-3.0/gdk-pixbuf.loaders gtk-query-immodules-3.0 | sed -e '/^#/d' > win32/gtk-3.0/gtk.immodules -./setup.py compile_catalog +python ./hatch_build.py ./setup-freeze.py install_exe -d dist cp `which gdbus.exe` dist/ makensis -DVERSION=${version} -DSERIES=${series} -DBITS=${bits} setup.nsi diff --git a/tryton/pyproject.toml b/tryton/pyproject.toml new file mode 100644 index 0000000000..87c4d450eb --- /dev/null +++ b/tryton/pyproject.toml @@ -0,0 +1,57 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton', 'babel'] +build-backend = 'hatchling.build' + +[project] +name = 'tryton' +dynamic = ['version', 'authors', 'readme'] +dependencies = [ + 'pycairo', + 'python-dateutil', + 'PyGObject >= 3.19', + ] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Desktop client for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "desktop", "client"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: X11 Applications :: GTK", + "Framework :: Tryton", + "Topic :: Office/Business", + ] + +[project.optional-dependencies] +calendar = ['GooCalendar >= 0.7'] +sound = ['playsound3'] + +[project.gui-scripts] +tryton = 'tryton.client:main' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/client-desktop/" +changelog = "https://docs.tryton.org/client-desktop/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.version] +path = 'tryton/__init__.py' + +[tool.hatch.build] +packages = ['tryton'] + +[tool.hatch.build.targets.wheel] +artifacts = ['*.mo'] + +[tool.hatch.build.hooks.custom] + +[tool.hatch.metadata.hooks.tryton] +copyright = 'COPYRIGHT' +readme = 'README.rst' diff --git a/tryton/setup-freeze.py b/tryton/setup-freeze.py index 934f34d716..6fd70ce0c7 100755 --- a/tryton/setup-freeze.py +++ b/tryton/setup-freeze.py @@ -8,7 +8,8 @@ import re import ssl import sys import tempfile -from subprocess import PIPE, Popen, check_call +from pathlib import Path +from subprocess import check_call from cx_Freeze import Executable, setup from setuptools import find_packages @@ -117,10 +118,9 @@ if os.path.exists(ssl_paths.openssl_capath): include_files.append( (ssl_paths.openssl_capath, os.path.join('share', 'ssl', 'certs'))) -version = Popen( - 'python3 ./setup.py --version', stdout=PIPE, shell=True, encoding='utf-8' - ).stdout.read() -version = version.strip() +version = re.search( + r'__version__ = "([0-9.]*)"', + Path('tryton', '__init__.py').read_text()).group(1) setup(name='tryton', version=version, diff --git a/tryton/setup.cfg b/tryton/setup.cfg deleted file mode 100644 index 03d3668005..0000000000 --- a/tryton/setup.cfg +++ /dev/null @@ -1,19 +0,0 @@ -[extract_messages] -copyright_holder = Tryton -msgid_bugs_address = issue_tracker@tryton.org -output_file = tryton/data/locale/tryton.pot -keywords = _ gettext N_:1,2 ngettext:1,2 - -[init_catalog] -domain = tryton -input_file = tryton/data/locale/tryton.pot -output_dir = tryton/data/locale - -[compile_catalog] -domain = tryton -directory = tryton/data/locale - -[update_catalog] -domain = tryton -input_file = tryton/data/locale/tryton.pot -output_dir = tryton/data/locale diff --git a/tryton/setup.py b/tryton/setup.py deleted file mode 100755 index 36ea06ee5d..0000000000 --- a/tryton/setup.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import io -import os -import re - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -args = {} -try: - from babel.messages import frontend as babel - - class extract_messages(babel.extract_messages): - def initialize_options(self): - super().initialize_options() - self.omit_header = True - self.no_location = True - - class update_catalog(babel.update_catalog): - def initialize_options(self): - super().initialize_options() - self.omit_header = True - self.ignore_obsolete = True - - args['cmdclass'] = { - 'compile_catalog': babel.compile_catalog, - 'extract_messages': extract_messages, - 'init_catalog': babel.init_catalog, - 'update_catalog': update_catalog, - } - - args['message_extractors'] = { - 'tryton': [ - ('**.py', 'python', None), - ], - } - -except ImportError: - pass - -package_data = { - 'tryton': ['data/pixmaps/tryton/*.png', - 'data/pixmaps/tryton/*.svg', - 'data/sounds/*.wav', - 'data/locale/*/LC_MESSAGES/*.mo', - 'data/locale/*/LC_MESSAGES/*.po', - ] - } -data_files = [] - - -def get_version(): - init = read(os.path.join('tryton', '__init__.py')) - return re.search('__version__ = "([0-9.]*)"', init).group(1) - - -version = get_version() -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'tryton' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -dist = setup(name=name, - version=version, - description='Tryton desktop client', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/client-desktop/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='business application ERP', - packages=find_packages(), - package_data=package_data, - data_files=data_files, - scripts=['bin/tryton'], - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: X11 Applications :: GTK', - 'Framework :: Tryton', - 'Intended Audience :: End Users/Desktop', - 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Japanese', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Topic :: Office/Business', - ], - platforms='any', - license='GPL-3', - python_requires='>=3.9', - install_requires=[ - 'pycairo', - "python-dateutil", - 'PyGObject>=3.19', - ], - extras_require={ - 'calendar': ['GooCalendar>=0.7'], - 'sound': ['playsound3'], - }, - zip_safe=False, - **args - ) diff --git a/tryton/tox.ini b/tryton/tox.ini index 9e2b33f4e7..b49c849d41 100644 --- a/tryton/tox.ini +++ b/tryton/tox.ini @@ -2,9 +2,9 @@ envlist = py38,py39,py310,py311,py312,py313 [testenv] -usedevelop = true +changedir = {toxworkdir} commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s tryton.tests {posargs} + coverage run --source=tryton --omit=*/tests/* -m xmlrunner discover -s tryton.tests {posargs} commands_post = coverage report coverage xml diff --git a/trytond-gis/COPYRIGHT b/trytond-gis/COPYRIGHT index 88a3419e62..5235419036 100644 --- a/trytond-gis/COPYRIGHT +++ b/trytond-gis/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (c) 2017-2025 B2CK. -Copyright (c) 2017-2025 Cédric Krier. -Copyright (c) 2017-2025 Nicolas Évrard. +Copyright (c) 2017-2025 B2CK SRL +Copyright (c) 2017-2025 Cédric Krier +Copyright (c) 2017-2025 Nicolas Évrard This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/trytond-gis/MANIFEST.in b/trytond-gis/MANIFEST.in deleted file mode 100644 index 005b0af076..0000000000 --- a/trytond-gis/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -graft doc diff --git a/trytond-gis/doc/conf.py b/trytond-gis/doc/conf.py index cc0a7f82ff..fe463de289 100644 --- a/trytond-gis/doc/conf.py +++ b/trytond-gis/doc/conf.py @@ -13,24 +13,22 @@ else: def get_info(): + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) info = dict() - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/trytond-gis/doc/requirements-doc.txt b/trytond-gis/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/trytond-gis/doc/requirements-doc.txt +++ b/trytond-gis/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/trytond-gis/pyproject.toml b/trytond-gis/pyproject.toml new file mode 100644 index 0000000000..5725553eaf --- /dev/null +++ b/trytond-gis/pyproject.toml @@ -0,0 +1,56 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond_gis' +dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme'] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Geographic Information System for Tryton" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'COPYRIGHT'] +keywords = ["tryton", "GIS"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Framework :: Tryton", + "Intended Audience :: Developers", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Python Modules", + ] + +[project.entry-points.'trytond.backend'] +postgis = 'trytond_gis.postgis' + +[project.entry-points.'trytond.tests'] +test_geographic_fields = 'trytond_gis.tests' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/backend-gis/" +changelog = "https://docs.tryton.org/backend-gis/releases.html" +forum = "https://discuss.tryton.org/tags/gis" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.version] +path = 'trytond_gis/__init__.py' + +[tool.hatch.build] +packages = ['trytond_gis'] + +[tool.hatch.metadata.hooks.tryton] +dependencies = [ + 'geomet', + 'psycopg2 >= 2.0.14', + ] +tryton_dependencies = ['trytond'] +copyright = 'COPYRIGHT' +readme = 'README.rst' + +[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies] +test = ['trytond[test]'] diff --git a/trytond-gis/setup.py b/trytond-gis/setup.py deleted file mode 100755 index c4af12bb8d..0000000000 --- a/trytond-gis/setup.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of trytond_gis. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. -import io -import os -import re - -from setuptools import find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def readme(): - content = read('README.rst') - content = re.sub( - r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) - return content - - -def get_require_version(name): - require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) - return require - - -def get_version(): - init = read(os.path.join('trytond_gis', '__init__.py')) - return re.search('__version__ = "([0-9.]*)"', init).group(1) - - -version = get_version() -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond_gis' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -requires = ['geomet', get_require_version('trytond'), 'psycopg2 >= 2.0.14'] -tests_require = [get_require_version('trytond[test]')] - -setup(name=name, - version=version, - description='Adds Geographic Information System support to trytond', - long_description=readme(), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/backend-gis/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='tryton GIS', - packages=find_packages(), - classifiers=[ - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Topic :: Software Development :: Libraries :: Python Modules' - ], - platforms='any', - license='GPL-3', - python_requires='>=3.9', - install_requires=requires, - extras_require={ - 'test': tests_require, - }, - entry_points={ - 'trytond.backend': [ - 'postgis = trytond_gis.postgis', - ], - 'trytond.tests': [ - 'test_geographic_fields = trytond_gis.tests', - ], - }, - zip_safe=False, - ) diff --git a/trytond-gis/tox.ini b/trytond-gis/tox.ini index 441270102a..28a7d9f642 100644 --- a/trytond-gis/tox.ini +++ b/trytond-gis/tox.ini @@ -2,11 +2,11 @@ envlist = py39,py310,py311,py312,py313 [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s trytond.tests {posargs} - coverage run -a --omit=*/tests/* -m xmlrunner discover -s trytond_gis.tests {posargs} + coverage run --source=trytond --omit=*/tests/* -m xmlrunner discover -s trytond.tests {posargs} + coverage run -a --source=trytond_gis --omit=*/tests/* -m xmlrunner discover -s trytond_gis.tests {posargs} commands_post = coverage report coverage xml diff --git a/trytond/COPYRIGHT b/trytond/COPYRIGHT index c2d60d0c2a..ae5cd04d61 100644 --- a/trytond/COPYRIGHT +++ b/trytond/COPYRIGHT @@ -1,9 +1,9 @@ -Copyright (C) 2004-2008 Tiny SPRL. -Copyright (C) 2007-2025 Cédric Krier. -Copyright (C) 2007-2013 Bertrand Chenal. -Copyright (C) 2008-2025 B2CK SPRL. -Copyright (C) 2011 Openlabs Technologies & Consulting (P) Ltd. -Copyright (C) 2011-2025 Nicolas Évrard. +Copyright (C) 2004-2008 Tiny SPRL +Copyright (C) 2007-2025 Cédric Krier +Copyright (C) 2007-2013 Bertrand Chenal +Copyright (C) 2008-2025 B2CK SRL +Copyright (C) 2011 Openlabs Technologies & Consulting (P) Ltd +Copyright (C) 2011-2025 Nicolas Évrard Copyright (C) 2020-2025 Maxime Richez Copyright (C) 2020-2025 SALUC SA diff --git a/trytond/MANIFEST.in b/trytond/MANIFEST.in deleted file mode 100644 index 0bbd4068ed..0000000000 --- a/trytond/MANIFEST.in +++ /dev/null @@ -1,9 +0,0 @@ -include CHANGELOG -include COPYRIGHT -include LICENSE -include README.rst -include doc/* -include trytond/ir/ui/icons/LICENSE -recursive-include doc *.rst -recursive-include doc *.po -recursive-include doc *.pot diff --git a/trytond/bin/trytond b/trytond/bin/trytond index 1f131f1802..0454f5a82a 100755 --- a/trytond/bin/trytond +++ b/trytond/bin/trytond @@ -2,91 +2,15 @@ # PYTHON_ARGCOMPLETE_OK # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -import glob -import logging + import os import sys -import threading - -try: - import argcomplete -except ImportError: - argcomplete = None DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, '..', '..', 'trytond'))) if os.path.isdir(DIR): sys.path.insert(0, os.path.dirname(DIR)) -import trytond.commandline as commandline -import trytond.config as config +from trytond.cli import main # noqa: E402 -parser = commandline.get_parser_daemon() -if argcomplete: - argcomplete.autocomplete(parser) -options = parser.parse_args() -commandline.config_log(options) -extra_files = config.update_etc(options.configfile) - -if options.coroutine: - # Monkey patching must be done before importing - from gevent import monkey - monkey.patch_all() - -from trytond.modules import get_module_info, get_modules -from trytond.pool import Pool -# Import trytond things after it is configured -from trytond.wsgi import app - -with commandline.pidfile(options): - Pool.start() - threads = [] - for name in options.database_names: - thread = threading.Thread(target=lambda: Pool(name).init()) - thread.start() - threads.append(thread) - for thread in threads: - thread.join() - hostname, port = config.split_netloc(config.get('web', 'listen')) - certificate = config.get('ssl', 'certificate') - try: - if config.getboolean('ssl', 'certificate'): - certificate = None - except ValueError: - pass - privatekey = config.get('ssl', 'privatekey') - try: - if config.getboolean('ssl', 'privatekey'): - privatekey = None - except ValueError: - pass - if certificate or privatekey: - from werkzeug.serving import load_ssl_context - ssl_args = dict( - ssl_context=load_ssl_context(certificate, privatekey)) - else: - ssl_args = {} - if options.dev and not options.coroutine: - for module in get_modules(): - info = get_module_info(module) - for ext in ['cfg', 'xml', - 'fodt', 'odt', 'fodp', 'odp', 'fods', 'ods', 'fodg', 'odg', - 'txt', 'html', 'xhtml']: - path = os.path.join(info['directory'], '**', '*.' + ext) - extra_files.extend(glob.glob(path, recursive=True)) - app.dev = options.dev - - if options.coroutine: - from gevent.pywsgi import WSGIServer - logger = logging.getLogger('gevent') - WSGIServer((hostname, port), app, - log=logger, - error_log=logger, - **ssl_args).serve_forever() - else: - from werkzeug.serving import run_simple - run_simple(hostname, port, app, - threaded=True, - extra_files=extra_files, - use_reloader=options.dev, - **ssl_args) +main() diff --git a/trytond/bin/trytond-admin b/trytond/bin/trytond-admin index cf660cafc3..ace81439b7 100755 --- a/trytond/bin/trytond-admin +++ b/trytond/bin/trytond-admin @@ -2,32 +2,15 @@ # PYTHON_ARGCOMPLETE_OK # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. + import os import sys -try: - import argcomplete -except ImportError: - argcomplete = None - DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, '..', '..', 'trytond'))) if os.path.isdir(DIR): sys.path.insert(0, os.path.dirname(DIR)) -import trytond.commandline as commandline -import trytond.config as config +from trytond.cli.admin import main # noqa: E402 -parser = commandline.get_parser_admin() -if argcomplete: - argcomplete.autocomplete(parser) -options = parser.parse_args() -if options.indexes is None: - options.indexes = bool(options.update) -config.update_etc(options.configfile) -commandline.config_log(options) - -# Import after application is configured -import trytond.admin as admin - -admin.run(options) +main() diff --git a/trytond/bin/trytond-console b/trytond/bin/trytond-console index 1276a3344a..7eed855976 100755 --- a/trytond/bin/trytond-console +++ b/trytond/bin/trytond-console @@ -2,29 +2,15 @@ # PYTHON_ARGCOMPLETE_OK # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. + import os import sys -try: - import argcomplete -except ImportError: - argcomplete = None - DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, '..', '..', 'trytond'))) if os.path.isdir(DIR): sys.path.insert(0, os.path.dirname(DIR)) -import trytond.commandline as commandline -import trytond.config as config +from trytond.cli.console import main # noqa: E402 -parser = commandline.get_parser_console() -if argcomplete: - argcomplete.autocomplete(parser) -options = parser.parse_args() -config.update_etc(options.configfile) - -# Import after application is configured -import trytond.console as console - -console.run(options) +main() diff --git a/trytond/bin/trytond-cron b/trytond/bin/trytond-cron index 91741d1e05..3ad371a3c3 100755 --- a/trytond/bin/trytond-cron +++ b/trytond/bin/trytond-cron @@ -2,38 +2,15 @@ # PYTHON_ARGCOMPLETE_OK # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. + import os import sys -try: - import argcomplete -except ImportError: - argcomplete = None - DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, '..', '..', 'trytond'))) if os.path.isdir(DIR): sys.path.insert(0, os.path.dirname(DIR)) -import trytond.commandline as commandline -import trytond.config as config +from trytond.cli.cron import main # noqa: E402 -parser = commandline.get_parser_cron() -if argcomplete: - argcomplete.autocomplete(parser) -options = parser.parse_args() -config.update_etc(options.configfile) -commandline.config_log(options) - -import trytond.cron as cron -# Import after application is configured -from trytond.pool import Pool - -# Ensure main module can be safely imported by a new interpreter -if __name__ == '__main__': - with commandline.pidfile(options): - try: - Pool.start() - cron.run(options) - except KeyboardInterrupt: - pass +main() diff --git a/trytond/bin/trytond-stat b/trytond/bin/trytond-stat index ea390e80ed..560fece4fb 100755 --- a/trytond/bin/trytond-stat +++ b/trytond/bin/trytond-stat @@ -2,142 +2,16 @@ # PYTHON_ARGCOMPLETE_OK # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -import curses -import datetime as dt -import math + import os import sys -from collections import defaultdict - -try: - import argcomplete -except ImportError: - argcomplete = None DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, '..', '..', 'trytond'))) if os.path.isdir(DIR): sys.path.insert(0, os.path.dirname(DIR)) -import trytond.commandline as commandline -import trytond.config as config -parser = commandline.get_parser_stat() -if argcomplete: - argcomplete.autocomplete(parser) -options = parser.parse_args() -config.update_etc(options.configfile) +from trytond.cli.stat import main # noqa: E402 -import trytond.status as status - - -def main(stdscr): - global reverse - stdscr.nodelay(1) - reverse = True - processes = {} - status_pad = curses.newpad(1, 1) - cache_pad = curses.newpad(1, 1) - - def refresh_status(): - now = dt.datetime.now() - height, width = stdscr.getmaxyx() - - def expired(process): - return process['expire'] > now - - def format_status(since, id_, request): - since = str(dt.timedelta(seconds=int(since))) - pid, node = id_.split('@', 1) - if len(node) > 12: - node = node[:5] + '…' + node[:6] - return f"{pid:>5} {node:<12} {since:>18} {request}" - status_pad.clear() - status = [format_status(*i) for i in sorted( - ((msg['since'], p['id'], msg['request']) - for p in filter(expired, processes.values()) - for msg in p['status']), - reverse=reverse)] - prow = min(len(status) + 1, height // 2) - pcol = max(max(map(len, status), default=0), width) - status_pad.resize(len(status) + 1, pcol + 1) - for i, line in enumerate(status, 1): - status_pad.addnstr(i, 0, line.ljust(pcol), pcol) - status_pad.addnstr( - 0, 0, "{pid:>5} {node:^12} {since:>18} {request} ({n})".format( - pid="pid", - node="node", - since="TIME" + ('↑' if reverse else '↓'), - request="request", - n=len(status), - ).upper().ljust(pcol), pcol, curses.A_REVERSE) - status_pad.noutrefresh(0, 0, 0, 0, prow, width - 1) - - def ratio(cache): - if cache['hit'] or cache['miss']: - return cache['hit'] / (cache['hit'] + cache['miss']) - return 0 - - def format_cache(name, hit, miss, ratio, size): - return f"{hit:{size}d} {miss:{size}d} {ratio * 100:6.2f} {name}" - - cache_pad.clear() - cache_stats = defaultdict(lambda: defaultdict(lambda: 0)) - for p in filter(expired, processes.values()): - for cache in p['caches']: - stats = cache_stats[cache['name']] - stats['name'] = cache['name'] - stats['hit'] += cache['hit'] - stats['miss'] += cache['miss'] - for cache in cache_stats.values(): - cache['ratio'] = ratio(cache) - try: - size = math.ceil(math.log10( - max(s['hit'] + s['miss'] for s in cache_stats.values()))) - except ValueError: - size = 1 - size = max(size, 4) - caches = [format_cache(size=size, **cache) for cache in sorted( - cache_stats.values(), key=lambda c: (c['ratio'], c['miss']), - reverse=reverse)] - crow = max(len(caches) + 1, (height - prow)) - ccol = max(max(map(len, caches), default=0), width) - cache_pad.resize(crow + 1, ccol + 1) - for i, line in enumerate(caches, 1): - cache_pad.addnstr(i, 0, line.ljust(ccol), ccol) - cache_pad.addstr( - 0, 0, - "{hit:>{size}} {miss:>{size}} {ratio:>6} {name} ({n})".format( - size=size, - hit="hit", - miss="miss", - ratio="% " + ('↑' if reverse else '↓'), - name="name", - n=len(caches), - ).upper().ljust(ccol), curses.A_REVERSE) - cache_pad.noutrefresh(0, 0, prow, 0, height - 1, width - 1) - - def refresh(): - global reverse - refresh_status() - stdscr.refresh() - - key = stdscr.getch() - if key == ord('q'): - sys.exit() - elif key == ord('r'): - reverse = not reverse - refresh() - - def update(data=None): - if data: - pid = data['id'] - data['expire'] = dt.datetime.now() + dt.timedelta(seconds=10) - processes[pid] = data - refresh() - refresh() - return status.listen(config.get('database', 'path'), update) - - -if not curses.wrapper(main): - sys.stderr.write("status not supported on this platform\n") +main() diff --git a/trytond/bin/trytond-worker b/trytond/bin/trytond-worker index 48baa04415..fac0c5913c 100755 --- a/trytond/bin/trytond-worker +++ b/trytond/bin/trytond-worker @@ -5,35 +5,11 @@ import os import sys -try: - import argcomplete -except ImportError: - argcomplete = None - DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, '..', '..', 'trytond'))) if os.path.isdir(DIR): sys.path.insert(0, os.path.dirname(DIR)) -import trytond.commandline as commandline -import trytond.config as config +from trytond.cli.worker import main # noqa: E402 -parser = commandline.get_parser_worker() -if argcomplete: - argcomplete.autocomplete(parser) -options = parser.parse_args() -config.update_etc(options.configfile) -commandline.config_log(options) - -import trytond.worker as worker -# Import after application is configured -from trytond.pool import Pool - -# Ensure main module can be safely imported by a new interpreter -if __name__ == '__main__': - with commandline.pidfile(options): - try: - Pool.start() - worker.work(options) - except (KeyboardInterrupt, SystemExit): - pass +main() diff --git a/trytond/doc/conf.py b/trytond/doc/conf.py index c4f32603d7..a9123dc580 100644 --- a/trytond/doc/conf.py +++ b/trytond/doc/conf.py @@ -15,24 +15,22 @@ else: def get_info(): + import json import subprocess - import sys module_dir = os.path.dirname(os.path.dirname(__file__)) info = dict() - result = subprocess.run( - [sys.executable, 'setup.py', '--name', '--description'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - info['name'], info['description'] = ( - result.stdout.decode('utf-8').strip().splitlines()) - - result = subprocess.run( - [sys.executable, 'setup.py', '--version'], - stdout=subprocess.PIPE, check=True, cwd=module_dir) - version = result.stdout.decode('utf-8').strip() - major_version, minor_version, _ = version.split('.', 2) + metadata_cmd = 'python -m build --quiet --metadata' + if os.environ.get('DOC_NO_ISOLATION'): + metadata_cmd += ' --no-isolation' + metadata = subprocess.check_output( + metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip() + metadata = json.loads(metadata) + info['name'] = metadata['name'] + info['description'] = metadata['summary'] + major_version, minor_version, _ = metadata['version'].split('.', 2) major_version = int(major_version) minor_version = int(minor_version) if minor_version % 2: diff --git a/trytond/doc/requirements-doc.txt b/trytond/doc/requirements-doc.txt index fee3b273bd..06b8565f6b 100644 --- a/trytond/doc/requirements-doc.txt +++ b/trytond/doc/requirements-doc.txt @@ -1,2 +1,3 @@ +build sphinx_book_theme sphinx_copybutton diff --git a/trytond/hatch_build.py b/trytond/hatch_build.py new file mode 100755 index 0000000000..8adbe296ab --- /dev/null +++ b/trytond/hatch_build.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import glob +import os.path +import subprocess +from pathlib import Path +from typing import Any + +from hatchling.builders.hooks.plugin.interface import BuildHookInterface + + +class CustomBuildHook(BuildHookInterface): + + def initialize(self, version: str, build_data: dict[str, Any]) -> None: + compile_rng(self.build_config.root) + + +def compile_rng(root: str) -> None: + for path in glob.glob('**/*.rnc', root_dir=root, recursive=True): + path = Path(path) + subprocess.run(['rnc2rng', path, path.with_suffix('.rng')], cwd=root) + + +if __name__ == '__main__': + compile_rng(os.path.dirname(__file__)) diff --git a/trytond/pyproject.toml b/trytond/pyproject.toml new file mode 100644 index 0000000000..06da48ab9a --- /dev/null +++ b/trytond/pyproject.toml @@ -0,0 +1,96 @@ +[build-system] +requires = ['hatchling >= 1', 'hatch-tryton', 'rnc2rng'] +build-backend = 'hatchling.build' + +[project] +name = 'trytond' +dynamic = ['version', 'authors', 'readme'] +dependencies = [ + 'Genshi', + 'backports.entry-points-selectable; python_version < "3.10"', + 'defusedxml', + 'lxml >= 2.0', + 'polib', + 'pwdlib[argon2] >= 0.2', + 'python-dateutil', + 'python-sql >= 1.5', + 'pytz; python_version < "3.9"', + 'relatorio[fodt] >= 0.7.0', + 'simpleeval', + 'werkzeug >= 0.12', + ] +requires-python = '>=3.9' +maintainers = [ + {name = "Tryton", email = "foundation@tryton.org"}, + ] +description = "Tryton server" +license = 'GPL-3.0-or-later' +license-files = ['LICENSE', 'COPYRIGHT'] +keywords = ["tryton"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Environment :: No Input/Output (Daemon)", + "Framework :: Tryton", + "Intended Audience :: Developers", + "Topic :: Office/Business", + "Topic :: Software Development :: Libraries :: Application Frameworks", + ] + +[project.optional-dependencies] +Levenshtein = ['python-Levenshtein'] +PostgreSQL = ['psycopg2 >= 2.7.0'] +barcode = ['python-barcode[images]'] +completion = ['argcomplete'] +coroutine = ['gevent >= 1.1'] +email-validation = [ + 'email-validator >= 2', + 'dnspython', + ] +graphviz = ['pydot'] +html2text = ['html2text'] +image = ['pillow'] +mjml = ['mrml'] +qrcode = [ + 'qrcode[pil]', + 'webcolors', + ] +test = [ + 'html2text', + 'pillow', + 'pydot', + ] +weasyprint = ['weasyprint'] + +[project.scripts] +trytond = 'trytond.cli:main' +trytond-admin = 'trytond.cli.admin:main' +trytond-console = 'trytond.cli.console:main' +trytond-cron = 'trytond.cli.cron:main' +trytond-stat = 'trytond.cli.stat:main' +trytond-worker = 'trytond.cli.worker:main' + +[project.urls] +homepage = "https://www.tryton.org/" +documentation = "https://docs.tryton.org/server/" +changelog = "https://docs.tryton.org/server/releases.html" +forum = "https://www.tryton.org/forum" +issues = "https://bugs.tryton.org/tryton" +repository = "https://code.tryton.org/tryton" +funding = "https://www.tryton.org/donate" + +[tool.hatch.version] +path = 'trytond/__init__.py' + +[tool.hatch.build] +packages = ['trytond'] +exclude = ['trytond/modules/*/**/*'] + +[tool.hatch.build.targets.wheel] +artifacts = ['*.rng'] + +[tool.hatch.build.hooks.custom] + +[tool.hatch.metadata.hooks.tryton] +copyright = 'COPYRIGHT' +readme = 'README.rst' diff --git a/trytond/setup.py b/trytond/setup.py deleted file mode 100755 index c0e16bb795..0000000000 --- a/trytond/setup.py +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/env python3 -# This file is part of Tryton. The COPYRIGHT file at the top level of -# this repository contains the full copyright notices and license terms. - -import glob -import io -import os -import re -import subprocess - -from setuptools import Command, find_packages, setup - - -def read(fname): - return io.open( - os.path.join(os.path.dirname(__file__), fname), - 'r', encoding='utf-8').read() - - -def get_version(): - init = read(os.path.join('trytond', '__init__.py')) - return re.search('__version__ = "([0-9.]*)"', init).group(1) - - -class rnc2rng(Command): - description = "Generate rng files from rnc" - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - os.chdir(os.path.dirname(__file__) or '.') - for path in glob.glob('**/*.rnc', recursive=True): - root, ext = os.path.splitext(path) - cmd = ['rnc2rng', path, root + '.rng'] - self.announce(' '.join(cmd)) - subprocess.run(cmd) - - -version = get_version() -major_version, minor_version, _ = version.split('.', 2) -major_version = int(major_version) -minor_version = int(minor_version) -name = 'trytond' - -if minor_version % 2: - download_url = '' -else: - download_url = 'http://downloads.tryton.org/%s.%s/' % ( - major_version, minor_version) - -tests_require = ['pillow', 'pydot', 'html2text'] - -setup(name=name, - version=version, - description='Tryton server', - long_description=read('README.rst'), - author='Tryton', - author_email='foundation@tryton.org', - url='http://www.tryton.org/', - download_url=download_url, - project_urls={ - "Bug Tracker": 'https://bugs.tryton.org/', - "Documentation": 'https://docs.tryton.org/latest/server/', - "Forum": 'https://www.tryton.org/forum', - "Source Code": 'https://code.tryton.org/tryton', - }, - keywords='business application platform ERP', - packages=find_packages(exclude=['*.modules.*', 'modules.*', 'modules', - '*.proteus.*', 'proteus.*', 'proteus']), - package_data={ - 'trytond': ['ir/ui/icons/*.svg', '*.rnc', '*.rng', 'ir/fonts/*.ttf'], - 'trytond.backend.postgresql': ['init.sql'], - 'trytond.backend.sqlite': ['init.sql'], - 'trytond.ir': ['tryton.cfg', '*.xml', 'view/*.xml', 'locale/*.po'], - 'trytond.ir.module': ['*.xml'], - 'trytond.ir.ui': ['*.xml', '*.rng', '*.rnc'], - 'trytond.res': [ - 'tryton.cfg', '*.xml', '*.html', 'view/*.xml', 'locale/*.po'], - 'trytond.tests': ['tryton.cfg', '*.xml', '*.txt', '*.mjml'], - }, - scripts=[ - 'bin/trytond', - 'bin/trytond-admin', - 'bin/trytond-console', - 'bin/trytond-cron', - 'bin/trytond-worker', - 'bin/trytond-stat', - ], - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Environment :: No Input/Output (Daemon)', - 'Framework :: Tryton', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: ' - 'GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', - 'Natural Language :: English', - 'Natural Language :: Finnish', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Indonesian', - 'Natural Language :: Italian', - 'Natural Language :: Persian', - 'Natural Language :: Polish', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Romanian', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', - 'Natural Language :: Spanish', - 'Natural Language :: Turkish', - 'Natural Language :: Ukrainian', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Software Development :: Libraries :: Application Frameworks', - ], - platforms='any', - license='GPL-3', - python_requires='>=3.9', - install_requires=[ - 'defusedxml', - 'lxml >= 2.0', - 'relatorio[fodt] >= 0.7.0', - 'Genshi', - 'python-dateutil', - 'polib', - 'python-sql >= 1.5', - 'simpleeval', - 'werkzeug >= 0.12', - 'pwdlib[argon2] >= 0.2', - 'pytz;python_version<"3.9"', - 'backports.entry-points-selectable;python_version<"3.10"', - ], - extras_require={ - 'test': tests_require, - 'PostgreSQL': ['psycopg2 >= 2.7.0'], - 'graphviz': ['pydot'], - 'Levenshtein': ['python-Levenshtein'], - 'html2text': ['html2text'], - 'weasyprint': ['weasyprint'], - 'mjml': ['mrml'], - 'coroutine': ['gevent>=1.1'], - 'image': ['pillow'], - 'barcode': ['python-barcode[images]'], - 'qrcode': ['qrcode[pil]', 'webcolors'], - 'completion': ['argcomplete'], - 'email-validation': ['email-validator >= 2', 'dnspython'], - }, - zip_safe=False, - cmdclass={ - 'update_rng': rnc2rng, - }, - ) diff --git a/trytond/tox.ini b/trytond/tox.ini index 448bbd0011..4a14cd885e 100644 --- a/trytond/tox.ini +++ b/trytond/tox.ini @@ -2,7 +2,7 @@ envlist = {py39,py310,py311,py312,py313}-{sqlite,postgresql} [testenv] -usedevelop = true +changedir = {toxworkdir} extras = test barcode @@ -10,7 +10,7 @@ extras = email-validation mjml commands = - coverage run --omit=*/tests/* -m xmlrunner discover -s trytond.tests {posargs} + coverage run --source=trytond --omit=*/tests/* -m xmlrunner discover -s trytond.tests {posargs} commands_post = coverage report coverage xml diff --git a/trytond/trytond/cli/__init__.py b/trytond/trytond/cli/__init__.py new file mode 100644 index 0000000000..ec56eac55a --- /dev/null +++ b/trytond/trytond/cli/__init__.py @@ -0,0 +1,91 @@ +# PYTHON_ARGCOMPLETE_OK +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import glob +import logging +import os +import threading + +import trytond.commandline as commandline +import trytond.config as config + + +def main(): + + parser = commandline.get_parser_daemon() + commandline.set_autocomplete(parser) + options = parser.parse_args() + commandline.config_log(options) + extra_files = config.update_etc(options.configfile) + + if options.coroutine: + # Monkey patching must be done before importing + from gevent import monkey + monkey.patch_all() + + from trytond.modules import get_module_info, get_modules + from trytond.pool import Pool + # Import trytond things after it is configured + from trytond.wsgi import app + + with commandline.pidfile(options): + Pool.start() + threads = [] + for name in options.database_names: + thread = threading.Thread(target=lambda: Pool(name).init()) + thread.start() + threads.append(thread) + for thread in threads: + thread.join() + hostname, port = config.split_netloc(config.get('web', 'listen')) + certificate = config.get('ssl', 'certificate') + try: + if config.getboolean('ssl', 'certificate'): + certificate = None + except ValueError: + pass + privatekey = config.get('ssl', 'privatekey') + try: + if config.getboolean('ssl', 'privatekey'): + privatekey = None + except ValueError: + pass + if certificate or privatekey: + from werkzeug.serving import load_ssl_context + ssl_args = dict( + ssl_context=load_ssl_context(certificate, privatekey)) + else: + ssl_args = {} + if options.dev and not options.coroutine: + for module in get_modules(): + info = get_module_info(module) + for ext in [ + 'cfg', 'xml', + 'fodt', 'odt', + 'fodp', 'odp', + 'fods', 'ods', + 'fodg', 'odg', + 'txt', 'html', 'xhtml']: + path = os.path.join(info['directory'], '**', '*.' + ext) + extra_files.extend(glob.glob(path, recursive=True)) + app.dev = options.dev + + if options.coroutine: + from gevent.pywsgi import WSGIServer + logger = logging.getLogger('gevent') + WSGIServer((hostname, port), app, + log=logger, + error_log=logger, + **ssl_args).serve_forever() + else: + from werkzeug.serving import run_simple + run_simple(hostname, port, app, + threaded=True, + extra_files=extra_files, + use_reloader=options.dev, + **ssl_args) + + +if __name__ == '__main__': + main() diff --git a/trytond/trytond/cli/__main__.py b/trytond/trytond/cli/__main__.py new file mode 100644 index 0000000000..b6207dd181 --- /dev/null +++ b/trytond/trytond/cli/__main__.py @@ -0,0 +1,8 @@ +# PYTHON_ARGCOMPLETE_OK +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +from . import main + +if __name__ == '__main__': + main() diff --git a/trytond/trytond/cli/admin.py b/trytond/trytond/cli/admin.py new file mode 100644 index 0000000000..fe77327d14 --- /dev/null +++ b/trytond/trytond/cli/admin.py @@ -0,0 +1,25 @@ +# PYTHON_ARGCOMPLETE_OK +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import trytond.commandline as commandline +import trytond.config as config + + +def main(): + parser = commandline.get_parser_admin() + commandline.set_autocomplete(parser) + options = parser.parse_args() + if options.indexes is None: + options.indexes = bool(options.update) + config.update_etc(options.configfile) + commandline.config_log(options) + + # Import after application is configured + import trytond.admin as admin + + admin.run(options) + + +if __name__ == '__main__': + main() diff --git a/trytond/trytond/cli/console.py b/trytond/trytond/cli/console.py new file mode 100644 index 0000000000..722b8a6e48 --- /dev/null +++ b/trytond/trytond/cli/console.py @@ -0,0 +1,22 @@ +# PYTHON_ARGCOMPLETE_OK +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import trytond.commandline as commandline +import trytond.config as config + + +def main(): + parser = commandline.get_parser_console() + commandline.set_autocomplete(parser) + options = parser.parse_args() + config.update_etc(options.configfile) + + # Import after application is configured + import trytond.console as console + + console.run(options) + + +if __name__ == '__main__': + main() diff --git a/trytond/trytond/cli/cron.py b/trytond/trytond/cli/cron.py new file mode 100644 index 0000000000..6b539c9f75 --- /dev/null +++ b/trytond/trytond/cli/cron.py @@ -0,0 +1,29 @@ +# PYTHON_ARGCOMPLETE_OK +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import trytond.commandline as commandline +import trytond.config as config + + +def main(): + parser = commandline.get_parser_cron() + commandline.set_autocomplete(parser) + options = parser.parse_args() + config.update_etc(options.configfile) + commandline.config_log(options) + + import trytond.cron as cron + # Import after application is configured + from trytond.pool import Pool + + with commandline.pidfile(options): + try: + Pool.start() + cron.run(options) + except KeyboardInterrupt: + pass + + +if __name__ == '__main__': + main() diff --git a/trytond/trytond/cli/stat.py b/trytond/trytond/cli/stat.py new file mode 100644 index 0000000000..79b7a99dca --- /dev/null +++ b/trytond/trytond/cli/stat.py @@ -0,0 +1,138 @@ +# PYTHON_ARGCOMPLETE_OK +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import curses +import datetime as dt +import math +import sys +from collections import defaultdict + +import trytond.commandline as commandline +import trytond.config as config + + +def main(): + parser = commandline.get_parser_stat() + commandline.set_autocomplete(parser) + options = parser.parse_args() + config.update_etc(options.configfile) + + import trytond.status as status + + def _main(stdscr): + global reverse + stdscr.nodelay(1) + reverse = True + processes = {} + status_pad = curses.newpad(1, 1) + cache_pad = curses.newpad(1, 1) + + def refresh_status(): + now = dt.datetime.now() + height, width = stdscr.getmaxyx() + + def expired(process): + return process['expire'] > now + + def format_status(since, id_, request): + since = str(dt.timedelta(seconds=int(since))) + pid, node = id_.split('@', 1) + if len(node) > 12: + node = node[:5] + '…' + node[:6] + return f"{pid:>5} {node:<12} {since:>18} {request}" + status_pad.clear() + status = [format_status(*i) for i in sorted( + ((msg['since'], p['id'], msg['request']) + for p in filter(expired, processes.values()) + for msg in p['status']), + reverse=reverse)] + prow = min(len(status) + 1, height // 2) + pcol = max(max(map(len, status), default=0), width) + status_pad.resize(len(status) + 1, pcol + 1) + for i, line in enumerate(status, 1): + status_pad.addnstr(i, 0, line.ljust(pcol), pcol) + status_pad.addnstr( + 0, 0, "{pid:>5} {node:^12} {since:>18} {request} ({n})".format( + pid="pid", + node="node", + since="TIME" + ('↑' if reverse else '↓'), + request="request", + n=len(status), + ).upper().ljust(pcol), pcol, curses.A_REVERSE) + status_pad.noutrefresh(0, 0, 0, 0, prow, width - 1) + + def ratio(cache): + if cache['hit'] or cache['miss']: + return cache['hit'] / (cache['hit'] + cache['miss']) + return 0 + + def format_cache(name, hit, miss, ratio, size): + return ( + f"{hit:{size}d} {miss:{size}d} {ratio * 100:6.2f} {name}") + + cache_pad.clear() + cache_stats = defaultdict(lambda: defaultdict(lambda: 0)) + for p in filter(expired, processes.values()): + for cache in p['caches']: + stats = cache_stats[cache['name']] + stats['name'] = cache['name'] + stats['hit'] += cache['hit'] + stats['miss'] += cache['miss'] + for cache in cache_stats.values(): + cache['ratio'] = ratio(cache) + try: + size = math.ceil(math.log10( + max(s['hit'] + s['miss'] + for s in cache_stats.values()))) + except ValueError: + size = 1 + size = max(size, 4) + caches = [format_cache(size=size, **cache) for cache in sorted( + cache_stats.values(), + key=lambda c: (c['ratio'], c['miss']), + reverse=reverse)] + crow = max(len(caches) + 1, (height - prow)) + ccol = max(max(map(len, caches), default=0), width) + cache_pad.resize(crow + 1, ccol + 1) + for i, line in enumerate(caches, 1): + cache_pad.addnstr(i, 0, line.ljust(ccol), ccol) + cache_pad.addstr( + 0, 0, + "{hit:>{size}} {miss:>{size}} {ratio:>6} {name} ({n})".format( + size=size, + hit="hit", + miss="miss", + ratio="% " + ('↑' if reverse else '↓'), + name="name", + n=len(caches), + ).upper().ljust(ccol), curses.A_REVERSE) + cache_pad.noutrefresh(0, 0, prow, 0, height - 1, width - 1) + + def refresh(): + global reverse + refresh_status() + stdscr.refresh() + + key = stdscr.getch() + if key == ord('q'): + sys.exit() + elif key == ord('r'): + reverse = not reverse + refresh() + + def update(data=None): + if data: + pid = data['id'] + data['expire'] = dt.datetime.now() + dt.timedelta(seconds=10) + processes[pid] = data + refresh() + refresh() + return status.listen(config.get('database', 'path'), update) + + if not curses.wrapper(_main): + sys.stderr.write("status not supported on this platform\n") + + +if __name__ == '__main__': + main() diff --git a/trytond/trytond/cli/worker.py b/trytond/trytond/cli/worker.py new file mode 100644 index 0000000000..811c184f7a --- /dev/null +++ b/trytond/trytond/cli/worker.py @@ -0,0 +1,29 @@ +# PYTHON_ARGCOMPLETE_OK +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import trytond.commandline as commandline +import trytond.config as config + + +def main(): + parser = commandline.get_parser_worker() + commandline.set_autocomplete(parser) + options = parser.parse_args() + config.update_etc(options.configfile) + commandline.config_log(options) + + import trytond.worker as worker + # Import after application is configured + from trytond.pool import Pool + + with commandline.pidfile(options): + try: + Pool.start() + worker.work(options) + except (KeyboardInterrupt, SystemExit): + pass + + +if __name__ == '__main__': + main() diff --git a/trytond/trytond/commandline.py b/trytond/trytond/commandline.py index 9c32ade3af..666ea6c3dd 100644 --- a/trytond/trytond/commandline.py +++ b/trytond/trytond/commandline.py @@ -222,6 +222,15 @@ def get_parser_stat(): return parser +def set_autocomplete(parser): + try: + import argcomplete + except ImportError: + argcomplete = None + if argcomplete: + argcomplete.autocomplete(parser) + + def config_log(options): if options.logconf: logging.config.fileConfig( diff --git a/trytond/trytond/ir/ui/board.rng b/trytond/trytond/ir/ui/board.rng deleted file mode 100644 index 5250e30251..0000000000 --- a/trytond/trytond/ir/ui/board.rng +++ /dev/null @@ -1,739 +0,0 @@ - - - - - board - - - - - - - - - - - - - - - - - - - - - col - - - - - - - image - - - - - - - name - - - - - - - colspan - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - xexpand - - 0 - 1 - - - - - - - - xfill - - 0 - 1 - - - - - - - - help - - - - - - - - states - - - - - - - separator - - - - - - - - string - - - - - - - - name - - - - name - - - - - - - - states - - - - - - - - xalign - - - - - - - - colspan - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - xexpand - - 0 - 1 - - - - - - - - xfill - - 0 - 1 - - - - - - - - help - - - - - - - label - - - - - - - - string - - - - - - - - name - - - - name - - - - - - - - states - - - - - - - - xalign - - - - - - - - yalign - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - xexpand - - 0 - 1 - - - - - - - - xfill - - 0 - 1 - - - - - - - - colspan - - - - - - - - help - - - - - - - newline - - - - - - - id - - - - - - link - - - - - - - name - - - - - - - id - - - - - - - - colspan - - - - - - - - states - - - - - - - - icon - - - - - - - - empty - - show - hide - - - - - - - notebook - - - - - - - - - - colspan - - - - - - - page - - - - - - - - - - - - - - - - - - - - - angle - - - - - - - - string - - - - - - - - col - - - - - - - - name - - - - id - - - - - - - group - - - - - - - - - - - - - - - - - - - - - string - - - - - - - - colspan - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - yalign - - - - - - - - xexpand - - 0 - 1 - - - - - - - - xfill - - 0 - 1 - - - - - - - - xalign - - - - - - - - rowspan - - - - - - - - col - - - - - - - id - - - - - - hpaned - - - - - - - - - vpaned - - - - - - - - - - colspan - - - - - - - - position - - - - - - - id - - - - - - child - - - - - - - - - - - - - - - - - - - - id - - - - - - data - - - - - - - - - - - - xpath - - - - - - - - - - - - - - - - - - - - - - - expr - - - - - - - position - - inside - replace - replace_attributes - after - before - - - - - - - action - - - - - - - name - - - - - - - colspan - - - - - - - - - - - - - - - diff --git a/trytond/trytond/ir/ui/calendar.rng b/trytond/trytond/ir/ui/calendar.rng deleted file mode 100644 index ef8f90d002..0000000000 --- a/trytond/trytond/ir/ui/calendar.rng +++ /dev/null @@ -1,145 +0,0 @@ - - - - - calendar - - - - - - - - - dtstart - - - - - - - dtend - - - - - - - - mode - - day - week - month - - - - - - - - editable - - 0 - 1 - - - - - - - - color - - - - - - - - background_color - - - - - - - - width - - - - - - - - height - - - - - - - field - - - - - - - name - - - - - - data - - - - - - - - - - - - xpath - - - - - - - - - - - - expr - - - - - - - position - - inside - replace - replace_attributes - after - before - - - - - - - - - - - diff --git a/trytond/trytond/ir/ui/form.rng b/trytond/trytond/ir/ui/form.rng deleted file mode 100644 index a8035c2fae..0000000000 --- a/trytond/trytond/ir/ui/form.rng +++ /dev/null @@ -1,1449 +0,0 @@ - - - - - form - - - - - - - - - - - - - - - - - - - - - - on_write - - - - - - - - creatable - - 0 - 1 - - - - - - - - col - - - - - - - - cursor - - - - - - - - scan_code - - one - submit - loop - - - - - - - - scan_code_depends - - - - - - - - scan_code_states - - - - - - - label - - - - - - - - string - - - - - - - - name - - - - id - - - - - - - - states - - - - - - - - xalign - - - - - - - - yalign - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - xexpand - - 0 - 1 - - - - - - - - xfill - - 0 - 1 - - - - - - - - colspan - - - - - - - - help - - - - - - - field - - - - - - - name - - - - - - - colspan - - - - - - - - widget - - binary - boolean - callto - char - color - date - datetime - dict - document - email - float - html - image - integer - many2many - many2one - multiselection - numeric - one2many - one2one - password - progressbar - pyson - reference - richtext - selection - sip - text - time - timedelta - url - - - - - - - - fill - - 0 - 1 - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - empty - - 0 - 1 - - - - - - - - xexpand - - 0 - 1 - - - - - - - - xfill - - 0 - 1 - - - - - - - - xalign - - - - - - - - yalign - - - - - - - - help - - - - - - - - width - - - - - - - - height - - - - - - - - readonly - - 0 - 1 - - - - - - - - tree_invisible - - 0 - 1 - - - - - - - - mode - - - - - - - - view_ids - - - - - - - - product - - - - - - - - invisible - - 0 - 1 - - - - - - - - create - - 0 - 1 - - - - - - - - delete - - 0 - 1 - - - - - - - - orientation - - left_to_right - right_to_left - bottom_to_top - top_to_bottom - - - - - - - - spell - - - - - - - - filename_visible - - 0 - 1 - - - - - - - - pre_validate - - 0 - 1 - - - - - - - - icon - - - - - - - - completion - - 0 - 1 - - - - - - - - string - - - - - - - - factor - - - - - - - - filename - - - - - - - - help_field - - - - - - - - toolbar - - 0 - 1 - - - - - - - - symbol - - - - - - - - grouping - - 0 - 1 - - - - - - - - border - - square - circle - rounded - - - - - - - - visible - - 0 - 1 - - - - - - - image - - - - - - - name - - - - - - - type - - icon - url - color - - - - - - - - url_size - - - - - - - - border - - square - circle - rounded - - - - - - - - colspan - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - xexpand - - 0 - 1 - - - - - - - - size - - - - - - - - xfill - - 0 - 1 - - - - - - - - help - - - - - - - - states - - - - - - - separator - - - - - - - - string - - - - - - - - name - - - - id - - - - - - - - states - - - - - - - - xalign - - - - - - - - colspan - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - xexpand - - 0 - 1 - - - - - - - - xfill - - 0 - 1 - - - - - - - - help - - - - - - - newline - - - - - - - - - - button - - - - - - - - colspan - - - - - - - - help - - - - - - - - string - - - - - - - - icon - - - - - - - - confirm - - - - - - - name - - - - - - - states - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - xexpand - - 0 - 1 - - - - - - - - xfill - - 0 - 1 - - - - - - - - keyword - - relate - print - action - - - - - - - - rule - - 0 - 1 - - - - - - - - change - - - - - - - - type - - class - instance - - - - - - - link - - - - - - - name - - - - - - - id - - - - - - - - colspan - - - - - - - - states - - - - - - - - icon - - - - - - - - empty - - show - hide - - - - - - - notebook - - - - - - - - - - colspan - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - states - - - - - - - - width - - - - - - - - height - - - - - - - page - - - - - - - - - - - - - - - - - - - - - - angle - - - - - - - - icon - - - - - - - - string - - - - - - - - col - - - - - - - - name - - - - id - - - - - - - - states - - - - - - - group - - - - - - - - - - - - - - - - - - - - - - string - - - - - - - - colspan - - - - - - - - yexpand - - 0 - 1 - - - - - - - - yfill - - 0 - 1 - - - - - - - - yalign - - - - - - - - xexpand - - 0 - 1 - - - - - - - - xfill - - 0 - 1 - - - - - - - - xalign - - - - - - - - rowspan - - - - - - - - col - - - - - - - - name - - - - id - - - - - - - - states - - - - - - - - homogeneous - - 0 - 1 - - - - - - - - expandable - - 0 - 1 - - - - - - - hpaned - - - - - - - - - vpaned - - - - - - - - - - colspan - - - - - - - - position - - - - - - - id - - - - - - child - - - - - - - - - - - - - - - - - - - - - id - - - - - - data - - - - - - - - - - - - xpath - - - - - - - - - - - - - - - - - - - - - - - - expr - - - - - - - position - - inside - replace - replace_attributes - after - before - - - - - - - - - - - diff --git a/trytond/trytond/ir/ui/graph.rng b/trytond/trytond/ir/ui/graph.rng deleted file mode 100644 index f5d1e4fff2..0000000000 --- a/trytond/trytond/ir/ui/graph.rng +++ /dev/null @@ -1,218 +0,0 @@ - - - - - graph - - - - - - - - - - - - - type - - vbar - hbar - line - pie - - - - - - - - background - - - - - - - - color - - - - - - - - legend - - 0 - 1 - - - - - - - x - - - - - - - - - - y - - - - - - - - - - - - field - - - - - - - name - - - - - - - string - - - - - - - - key - - - - - - - - domain - - - - - - - - fill - - 0 - 1 - - - - - - - - empty - - 0 - 1 - - - - - - - - color - - - - - - - - timedelta - - - - - - - - interpolation - - constant-left - constant-right - constant-center - linear - - - - - - - data - - - - - - - - - - - - xpath - - - - - - - - - - - - - - expr - - - - - - - position - - inside - replace - replace_attributes - after - before - - - - - - - - - - - diff --git a/trytond/trytond/ir/ui/tree.rng b/trytond/trytond/ir/ui/tree.rng deleted file mode 100644 index 7e861d2cd4..0000000000 --- a/trytond/trytond/ir/ui/tree.rng +++ /dev/null @@ -1,563 +0,0 @@ - - - - - tree - - - - - - - - - - - - - on_write - - - - - - - - editable - - 0 - 1 - - - - - - - - creatable - - 0 - 1 - - - - - - - - sequence - - - - - - - - keyword_open - - 0 - 1 - - - - - - - - tree_state - - 0 - 1 - - - - - - - - visual - - - - - - - field - - - - - - - - - - - - name - - - - - - - readonly - - 0 - 1 - - - - - - - - widget - - binary - boolean - callto - char - date - datetime - email - float - image - integer - many2many - many2one - multiselection - numeric - one2many - one2one - progressbar - reference - selection - sip - text - time - timedelta - url - - - - - - - - tree_invisible - - - - - - - - optional - - 0 - 1 - - - - - - - - expand - - - - - - - - visual - - - - - - - - icon - - - - - - - - sum - - 0 - 1 - - - - - - - - width - - - - - - - - height - - - - - - - - create - - 0 - 1 - - - - - - - - delete - - 0 - 1 - - - - - - - - orientation - - left_to_right - right_to_left - bottom_to_top - top_to_bottom - - - - - - - - pre_validate - - 0 - 1 - - - - - - - - completion - - 0 - 1 - - - - - - - - string - - - - - - - - factor - - - - - - - - filename - - - - - - - - help_field - - - - - - - - view_ids - - - - - - - - symbol - - - - - - - - grouping - - 0 - 1 - - - - - - - prefix - - - - - - - suffix - - - - - - - - string - - - - - - - - name - - - - id - - - - - - - - icon - - - - - - - - icon_type - - icon - url - color - - - - - - - - url_size - - - - - - - - border - - square - circle - rounded - - - - - - - button - - - - - - - - help - - - - - - - - string - - - - - - - - confirm - - - - - - - name - - - - - - - states - - - - - - - - keyword - - relate - print - action - - - - - - - - change - - - - - - - - type - - class - instance - - - - - - - - tree_invisible - - - - - - - - width - - - - - - - - multiple - - 0 - 1 - - - - - - - data - - - - - - - - - - - - xpath - - - - - - - - - - - - - - - expr - - - - - - - position - - inside - replace - replace_attributes - after - before - - - - - - - - - - - diff --git a/trytond/trytond/tryton.rng b/trytond/trytond/tryton.rng deleted file mode 100644 index 1a431e9c1b..0000000000 --- a/trytond/trytond/tryton.rng +++ /dev/null @@ -1,234 +0,0 @@ - - - - - tryton - - - - - - - - - - - - data - - - - - - - - - - - - - noupdate - - 0 - 1 - - - - - - - - grouped - - 0 - 1 - - - - - - - - depends - - - - - - - - language - - - - - - - record - - - - - - - - - model - - - - - - id - - - - - - - update - - 0 - 1 - - - - - - - field - - - - - - - name - - - - - - - search - - - - - - - - ref - - - - - - - - eval - - - - - - - - pyson - - 0 - 1 - - - - - - - - type - xml - - - - - - - depends - - - - - - - menuitem - - - - - - - id - - - - - - - name - - - - - - - - icon - - - - - - - - sequence - - - - - - - - parent - - - - - - - - action - - - - - - - - groups - - - - - - - - active - - - - - - - -