Skip to content

Simplify setup.py#301

Merged
avalentino merged 1 commit into
liberfa:mainfrom
eerovaher:simpler-setup
Jul 25, 2026
Merged

Simplify setup.py#301
avalentino merged 1 commit into
liberfa:mainfrom
eerovaher:simpler-setup

Conversation

@eerovaher

Copy link
Copy Markdown
Contributor

There are a handful of simplifications that can be applied to setup.py without changing what it does.

Comment thread setup.py
config_h.write_text(version_definitions)
else:
warn("unable to get liberfa version")
if config_h.exists():

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As far as I can tell the if-statement should have been removed when 0148ea0 removed the accompanying elif-block.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking at 0148ea0, the problem is that without a config.h it is not possible to generate a valid sdist.
I think (not sure by the way) that it is still possible to build liberfa without config.h but in that case HAVE_CONFIG_H should not be set.

IMHO the old behavior (pre 0148ea0) was correct.

If you still want to simplify then at least the warning above should become a raise SomeException(...), maybe.

Comment thread setup.py
config_h.write_text(version_definitions)
else:
warn("unable to get liberfa version")
if config_h.exists():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking at 0148ea0, the problem is that without a config.h it is not possible to generate a valid sdist.
I think (not sure by the way) that it is still possible to build liberfa without config.h but in that case HAVE_CONFIG_H should not be set.

IMHO the old behavior (pre 0148ea0) was correct.

If you still want to simplify then at least the warning above should become a raise SomeException(...), maybe.

Comment thread setup.py
}
include_dirs.extend(map(str, [ERFA_SRC, LIBERFADIR]))
define_macros.append(("HAVE_CONFIG_H", "1"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not OK if the user wants to use the system version of liberfa (PYERFA_USE_SYSTEM_LIBERFA set in the environment).
The last two instructions should be part of the else clause.

@avalentino

Copy link
Copy Markdown
Member

Apparently these is some issue with the CI.
It seems unrelated so I will merge anyways
@eerovaher do you have any idea about what could be the issue?

@avalentino
avalentino merged commit bb09f30 into liberfa:main Jul 25, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants