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

auto-versioning and adding axolotl.__version__ #2127

Merged
merged 4 commits into from
Dec 6, 2024
Merged

Conversation

djsaunde
Copy link
Contributor

@djsaunde djsaunde commented Dec 5, 2024

Description

Small change using importlib magic to automagically populate the package version based on git tags.

Motivation and Context

Small QoL improvement for devs and users. Modernizing packaging approach a bit with basic pyproject.toml.

How has this been tested?

On main branch:

# pip install -e .
...
Successfully installed axolotl-0.5.2  # hardcoded version in setup.py, no current commit information

In [1]: from importlib.metadata import version

In [2]: import axolotl

In [3]: axolotl.__version__
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[3], line 1
----> 1 axolotl.__version__

AttributeError: module 'axolotl' has no attribute '__version__'

In Runpod, on this branch:

# pip install -e .
...
Successfully installed axolotl-0.5.3.dev34+gccf7b097  # incremented version with current state (+34 commits) and git hash

# ipython
...
In [1]: from importlib.metadata import version

In [2]: import axolotl

In [3]: axolotl.__version__
Out[3]: '0.5.3.dev34+gccf7b097'

Types of changes

Packaging / package meta improvements.

@djsaunde djsaunde self-assigned this Dec 5, 2024
@djsaunde
Copy link
Contributor Author

djsaunde commented Dec 5, 2024

I'd recommend moving fully to pyproject.toml at some point, as it's the recommended approach these days. But that's a separate conversation!

@djsaunde djsaunde marked this pull request as draft December 5, 2024 22:43
@winglian
Copy link
Collaborator

winglian commented Dec 6, 2024

adding the pyproject.toml seems to supersede setup.py and breaks the extras

WARNING: axolotl 0.1.dev5+g4c60a74 does not provide the extra 'deepspeed'
WARNING: axolotl 0.1.dev5+g4c60a74 does not provide the extra 'flash-attn'
WARNING: axolotl 0.1.dev5+g4c60a74 does not provide the extra 'optimizers'

@winglian
Copy link
Collaborator

winglian commented Dec 6, 2024

okay, I think this is good to go now unless there were additional changes you wanted to add.

@djsaunde djsaunde marked this pull request as ready for review December 6, 2024 02:47
@djsaunde
Copy link
Contributor Author

djsaunde commented Dec 6, 2024

            # Convert `HTTPError` into a `HfHubHTTPError` to display request information
            # as well (request id and/or server error message)
>           raise _format(HfHubHTTPError, str(e), response) from e
E           huggingface_hub.errors.HfHubHTTPError: 503 Server Error: Service Temporarily Unavailable for url: https://huggingface.co/api/datasets/allenai/c4/revision/1588ec454efa1a09f29cd18ddd04fe05fc8653a2

/root/miniconda3/envs/py3.10/lib/python3.10/site-packages/huggingface_hub/utils/_http.py:477: HfHubHTTPError

Looks like a flaky test failure (503 service unavailable; happens in both docker-e2e-tests tests), will rerun.

@djsaunde djsaunde merged commit 2f3ebbc into main Dec 6, 2024
15 checks passed
@winglian winglian deleted the use_scm_version branch December 6, 2024 03:32
djsaunde added a commit that referenced this pull request Dec 16, 2024
* auto-versioning and adding axolotl.__version__

* removing file meant for codecov PR

* adding dynamic dependencies, project metadata

* extras/optional-dependencies are dynamic too

---------

Co-authored-by: Dan Saunders <dan@axolotl.ai>
Co-authored-by: Wing Lian <wing@axolotl.ai>
djsaunde added a commit that referenced this pull request Dec 17, 2024
* auto-versioning and adding axolotl.__version__

* removing file meant for codecov PR

* adding dynamic dependencies, project metadata

* extras/optional-dependencies are dynamic too

---------

Co-authored-by: Dan Saunders <dan@axolotl.ai>
Co-authored-by: Wing Lian <wing@axolotl.ai>
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