Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete redundant vesion.py #355

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Delete redundant vesion.py #355

merged 2 commits into from
Jan 31, 2024

Conversation

teutoburg
Copy link
Contributor

After discussing with @astronomyk , we decided that the __version__ variable in __init__.py is sufficient, similar to what we recently did in another package.

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (b20f0f8) 75.13% compared to head (cfc9b89) 75.14%.

Files Patch % Lines
scopesim/__init__.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           dev_master     #355   +/-   ##
===========================================
  Coverage       75.13%   75.14%           
===========================================
  Files              59       58    -1     
  Lines            7999     7993    -6     
===========================================
- Hits             6010     6006    -4     
+ Misses           1989     1987    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@astronomyk
Copy link
Collaborator

Looks good 👍

@astronomyk astronomyk merged commit 4879411 into dev_master Jan 31, 2024
24 of 25 checks passed
@astronomyk astronomyk deleted the fh/versionpy branch January 31, 2024 11:54
@hugobuddel
Copy link
Collaborator

Not sure everything with the versioning actually works as intended. (Intended by us I mean; everything probably works as intended by the tooling.)

See this scenario with a semi fresh ScopeSim clone and semi fresh environment, without ScopeSim installed. Alternating between an empty directory and ScopeSim clone:

Empty directory, as expected:

$ python -c "import scopesim"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'scopesim'

In fresh clone install an old version of ScopeSim. More realistic scenario is installing dev_master now, and then wait a couple of weeks until the versions roll over, so we are mimicking that by explicitly installing something old.

$ git checkout v0.6.2
$ pip install -e .

In empty directory, as expected again::

$ python -c "import scopesim; print(scopesim.__version__)"
0.6.2
$ python -c "import scopesim; print(scopesim.__file__)"
[...]/repos/scopesim/ScopeSim/scopesim/__init__.py
$ python -c "from scopesim.effects.electronic import Quantization"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'Quantization' from 'scopesim.effects.electronic' ([...]/repos/scopesim/ScopeSim/scopesim/effects/electronic.py)

These files are installed:

$ find [...]/envs/metiswise2/lib/python3.11/site-packages/ -iname "*scopesim*"
[...]/envs/metiswise2/lib/python3.11/site-packages/__pycache__/__editable___ScopeSim_0_6_2_finder.cpython-311.pyc
[...]/envs/metiswise2/lib/python3.11/site-packages/__editable___ScopeSim_0_6_2_finder.py
[...]/envs/metiswise2/lib/python3.11/site-packages/__editable__.ScopeSim-0.6.2.pth
[...]/envs/metiswise2/lib/python3.11/site-packages/ScopeSim-0.6.2.dist-info

In git clone:

$ git checkout dev_master

In empty directory:

$ python -c "import scopesim; print(scopesim.__version__)"
0.6.2
$ python -c "from scopesim.effects.electronic import Quantization"
# no output
$ python
>>> import scopesim; from pathlib import Path; import toml;
>>> toml.load(Path(scopesim.__file__).parent.parent / "pyproject.toml")['tool']['poetry']['version']
'0.8.0a0'

People are surely going to install ScopeSim in this way.

So maybe we should have bug_report() also try to get the version from pyproject.toml?

@hugobuddel
Copy link
Collaborator

I created #359 to discuss reading the versions, as the issue is not specific to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants