Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
hg-git
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
hg-git
Commits
7b52dc1b
Commit
7b52dc1b
authored
3 years ago
by
Dan Villiom Podlaski Christiansen
Browse files
Options
Downloads
Patches
Plain Diff
setup: use setup.cfg & setuptools_scm
parent
24c32a1d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!134
Use setuptools & setuptools_scm
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.hgignore
+3
-0
3 additions, 0 deletions
.hgignore
hggit/__init__.py
+27
-5
27 additions, 5 deletions
hggit/__init__.py
pyproject.toml
+11
-0
11 additions, 0 deletions
pyproject.toml
setup.cfg
+22
-0
22 additions, 0 deletions
setup.cfg
setup.py
+6
-39
6 additions, 39 deletions
setup.py
with
69 additions
and
44 deletions
.hgignore
+
3
−
0
View file @
7b52dc1b
syntax: re
^hggit/__version__\.py$
syntax: glob
*.pyc
tests/*.err
...
...
This diff is collapsed.
Click to expand it.
hggit/__init__.py
+
27
−
5
View file @
7b52dc1b
...
...
@@ -150,6 +150,8 @@
from
.
import
schemes
from
.
import
templates
import
dulwich
from
mercurial
import
(
demandimport
,
exthelper
,
...
...
@@ -160,8 +162,6 @@
b
'
collections
'
,
}
__version__
=
b
'
0.11.0dev
'
testedwith
=
(
b
'
5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0
'
)
minimumhgversion
=
b
'
5.2
'
buglink
=
b
'
https://foss.heptapod.net/mercurial/hg-git/issues
'
...
...
@@ -194,6 +194,28 @@
def
getversion
():
"""
return version with dependencies for hg --version -v
"""
import
dulwich
dulver
=
b
'
.
'
.
join
(
pycompat
.
sysbytes
(
str
(
i
))
for
i
in
dulwich
.
__version__
)
return
__version__
+
(
b
"
(dulwich %s)
"
%
dulver
)
# first, try to get a built version
try
:
from
.__version__
import
version
except
ImportError
:
version
=
None
# if that fails, try to determine the version from the checkout
if
version
is
None
:
try
:
from
setuptools_scm
import
get_version
version
=
get_version
(
root
=
'
..
'
,
relative_to
=
__file__
,
version_scheme
=
"
release-branch-semver
"
,
)
except
:
# something went wrong, but we need to provide something
version
=
"
unknown
"
# include the dulwich version, as it's fairly important for the
# level of functionality
dulver
=
'
.
'
.
join
(
map
(
str
,
dulwich
.
__version__
))
return
pycompat
.
sysbytes
(
"
%s (dulwich %s)
"
%
(
version
,
dulver
))
This diff is collapsed.
Click to expand it.
pyproject.toml
0 → 100644
+
11
−
0
View file @
7b52dc1b
[build-system]
requires
=
[
"setuptools >= 42"
,
"setuptools_scm[toml]>
=
6.0
",
"wheel"
,
]
build-backend
=
"setuptools.build_meta"
[tool.setuptools_scm]
write_to
=
"hggit/__version__.py"
version_scheme
=
"release-branch-semver"
This diff is collapsed.
Click to expand it.
setup.cfg
+
22
−
0
View file @
7b52dc1b
[metadata]
name
=
hg-git
author
=
Scott Chacon, Augie Fackler, Kevin Bullock and others
maintainer
=
The hg-git maintainers
maintainer_email
=
hg-git@googlegroups.com
url
=
http://foss.heptapod.net/mercurial/hg-git
description
=
push to and pull from a Git repository using Mercurial
long_description
=
file:README.rst
keywords
=
hg git mercurial
license
=
GPLv2
[options]
include_package_data
=
True
zip_safe
=
False
python_requires
=
>=3.6
packages
=
hggit
install_requires
=
dulwich>=0.19.3
[options.package_data]
*
=
*.txt,
*.rst
[flake8]
# E,W will ignore all pep8
ignore
=
E129
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
6
−
39
View file @
7b52dc1b
from
__future__
import
generator_stop
from
os.path
import
dirname
,
join
import
setuptools
try
:
...
...
@@ -4,20 +2,7 @@
try
:
from
setuptools
import
setup
except
:
from
distutils.core
import
setup
def
get_file
(
relpath
):
root
=
dirname
(
__file__
)
with
open
(
join
(
root
,
relpath
))
as
fp
:
return
fp
.
read
().
strip
()
def
get_version
(
relpath
):
for
line
in
get_file
(
relpath
).
splitlines
():
line
=
line
if
'
__version__
'
in
line
:
return
line
.
split
(
"'"
)[
1
]
import
setuptools_scm
assert
setuptools_scm
# silence pyflakes
except
ImportError
:
pass
...
...
@@ -23,20 +8,2 @@
setup
(
name
=
'
hg-git
'
,
version
=
get_version
(
'
hggit/__init__.py
'
),
author
=
'
The hg-git Authors
'
,
maintainer
=
'
Kevin Bullock
'
,
maintainer_email
=
'
kbullock+mercurial@ringworld.org
'
,
url
=
'
http://foss.heptapod.net/mercurial/hg-git
'
,
description
=
'
push to and pull from a Git repository using Mercurial
'
,
long_description
=
get_file
(
"
README.rst
"
),
keywords
=
'
hg git mercurial
'
,
license
=
'
GPLv2
'
,
packages
=
[
'
hggit
'
],
include_package_data
=
True
,
zip_safe
=
True
,
python_requires
=
'
>=3.6
'
,
install_requires
=
[
'
dulwich>=0.19.3
'
,
],
)
setuptools
.
setup
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment