Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-auth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-auth
Commits
bd3d8437
Verified
Commit
bd3d8437
authored
4 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
setup: Adapt parse_requirements function according to template
parent
dfc1252d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+18
-20
18 additions, 20 deletions
setup.py
with
18 additions
and
20 deletions
setup.py
+
18
−
20
View file @
bd3d8437
#!/usr/bin/env python3
# Copyright (C) 2019-202
0
The Software Heritage developers
# Copyright (C) 2019-202
1
The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
...
...
@@ -16,31 +16,29 @@ with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description
=
f
.
read
()
def
parse_requirements
(
name
=
None
):
if
name
:
reqf
=
"
requirements-%s.txt
"
%
name
else
:
reqf
=
"
requirements.txt
"
def
parse_requirements
(
*
names
):
requirements
=
[]
if
not
path
.
exists
(
reqf
):
return
requirements
for
name
in
names
:
if
name
:
reqf
=
"
requirements-%s.txt
"
%
name
else
:
reqf
=
"
requirements.txt
"
if
not
path
.
exists
(
reqf
):
return
requirements
with
open
(
reqf
)
as
f
:
for
line
in
f
.
readlines
():
line
=
line
.
strip
()
if
not
line
or
line
.
startswith
(
"
#
"
):
continue
requirements
.
append
(
line
)
with
open
(
reqf
)
as
f
:
for
line
in
f
.
readlines
():
line
=
line
.
strip
()
if
not
line
or
line
.
startswith
(
"
#
"
):
continue
requirements
.
append
(
line
)
return
requirements
# Edit this part to match your module.
# Full sample:
# https://forge.softwareheritage.org/diffusion/DCORE/browse/master/setup.py
setup
(
name
=
"
swh.auth
"
,
description
=
"
Software Heritage Authentication
"
,
description
=
"
Software Heritage Authentication
Utilities
"
,
long_description
=
long_description
,
long_description_content_type
=
"
text/markdown
"
,
python_requires
=
"
>=3.7
"
,
...
...
@@ -48,7 +46,7 @@ setup(
author_email
=
"
swh-devel@inria.fr
"
,
url
=
"
https://forge.softwareheritage.org/source/swh-auth/
"
,
packages
=
find_packages
(),
# packages's modules
install_requires
=
parse_requirements
(
)
+
parse_requirements
(
"
swh
"
),
install_requires
=
parse_requirements
(
None
,
"
swh
"
),
tests_require
=
parse_requirements
(
"
test
"
),
setup_requires
=
[
"
setuptools-scm
"
],
use_scm_version
=
True
,
...
...
This diff is collapsed.
Click to expand it.
Phabricator Migration user
@phabricator-migration
mentioned in merge request
!41 (closed)
·
2 years ago
mentioned in merge request
!41 (closed)
mentioned in merge request !41
Toggle commit list
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