Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wumpus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Sanaz.Khosropour
wumpus
Commits
4df4a409
Commit
4df4a409
authored
3 years ago
by
Tessaris Sergio
Browse files
Options
Downloads
Patches
Plain Diff
build: declarative package definition
parent
e2cb799b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
setup.cfg
+21
-0
21 additions, 0 deletions
setup.cfg
setup.py
+4
-60
4 additions, 60 deletions
setup.py
with
25 additions
and
60 deletions
setup.cfg
0 → 100644
+
21
−
0
View file @
4df4a409
[metadata]
name
=
wumpus
version
=
attr:wumpus.__version__
description
=
My package description
long_description
=
file: README.md
license
=
MIT
author
=
Sergio Tessaris
author_email
=
tessaris@inf.unibz.it
[options]
zip_safe
=
False
include_package_data
=
True
packages
=
find:
python_requires
=
>=3.7
[options.entry_points]
console_scripts
=
gridrunner
=
wumpus.cli:main
[options.extras_require]
gym
=
gym
This diff is collapsed.
Click to expand it.
setup.py
+
4
−
60
View file @
4df4a409
from
setuptools
import
setup
,
find_packages
import
re
import
codecs
import
os
import
subprocess
#!/usr/bin/env python
import
setuptools
# Hack to allow non-normalised versions
# see <https://github.com/pypa/setuptools/issues/308>
from
setuptools.extern.packaging
import
version
version
.
Version
=
version
.
LegacyVersion
_INCLUDE_GIT_REV_
=
False
# see <https://stackoverflow.com/a/39671214> and
# <https://packaging.python.org/guides/single-sourcing-package-version>
def
find_version
(
*
pkg_path
):
pkg_dir
=
os
.
path
.
join
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)),
*
pkg_path
)
version_file
=
codecs
.
open
(
os
.
path
.
join
(
pkg_dir
,
'
__init__.py
'
),
'
r
'
).
read
()
version_match
=
re
.
search
(
r
"
^__version__ = [
'
\"]([^
'
\"]*)[
'
\"]
"
,
version_file
,
re
.
M
)
_git_revision_
=
None
if
_INCLUDE_GIT_REV_
:
try
:
_git_revision_
=
subprocess
.
check_output
([
'
git
'
,
'
describe
'
,
'
--always
'
,
'
--dirty
'
],
encoding
=
'
utf-8
'
).
strip
()
except
subprocess
.
CalledProcessError
:
pass
if
version_match
:
return
version_match
.
group
(
1
)
+
(
''
if
_git_revision_
is
None
else
'
+
'
+
_git_revision_
)
elif
_git_revision_
:
return
_git_revision_
raise
RuntimeError
(
"
Unable to find version string.
"
)
def
long_description_md
(
fname
=
'
README.md
'
):
this_directory
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
with
open
(
os
.
path
.
join
(
this_directory
,
fname
),
encoding
=
'
utf-8
'
)
as
f
:
long_description
=
f
.
read
()
return
long_description
setup
(
name
=
'
wumpus
'
,
version
=
find_version
(
'
wumpus
'
),
description
=
'
Wumpus world simulator
'
,
long_description
=
long_description_md
(),
long_description_content_type
=
'
text/markdown
'
,
author
=
'
Sergio Tessaris
'
,
author_email
=
'
tessaris@inf.unibz.it
'
,
packages
=
find_packages
(),
include_package_data
=
True
,
entry_points
=
{
'
console_scripts
'
:
[
'
gridrunner=wumpus.cli:main
'
]
},
install_requires
=
[
],
extras_require
=
{
'
gym
'
:
[
'
gym
'
]
},
exclude_package_data
=
{
''
:
[
'
.gitignore
'
]},
)
if
__name__
==
"
__main__
"
:
setuptools
.
setup
()
\ No newline at end of file
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