Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P pyod
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 144
    • Issues 144
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Yue Zhao
  • pyod
  • Merge requests
  • !295

Added automatic generation of the `__version__` attribute.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Sylvain Marié requested to merge github/fork/smarie/fix_issue_253 into master Apr 12, 2021
  • Overview 1
  • Commits 1
  • Pipelines 1
  • Changes 5

Fixes #253

  • setuptools_scm was added as a setup dependency and ci dependency
  • use_scm_version (from setuptools_scm) is used instead of version to always generate the right version number based on git.
  • in addition, write_to is used in use_scm_version so that a _version.py file is automatically created when building the wheel.
  • Finally the __init__.py contains code supporting the two cases: either the _version.py file is present and it should be read, or it is not present and setuptools_scm is used programmatically to generate the version based on git information

.gitignore was modified so that the _version.py file cannot be added by mistake.

All these best practices come from https://smarie.github.io/python-getversion/#package-versioning-best-practices

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/smarie/fix_issue_253