-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish package artifacts to internal artifact feed (#554)
* publish package artifacts to internal artifact feed * use a project-scoped feed? * reference package version from git through env var * dynamic resolve package version * change package name for ci * use MANIFEST.in to specify dependencies after build time * use include_package_data
- Loading branch information
1 parent
7f50d69
commit d033891
Showing
3 changed files
with
27 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include README.md | ||
|
||
graft tracker/templates | ||
graft tracker/static | ||
graft tracker/locale | ||
graft tracker/fixtures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
|
||
from setuptools import Command, find_packages, setup | ||
|
||
PACKAGE_NAME_SUFFIX = os.environ.get('PACKAGE_NAME_SUFFIX', None) | ||
|
||
|
||
class PackageCommand(Command): | ||
user_options = [] | ||
|
@@ -22,21 +24,14 @@ def run(self): | |
self.run_command('bdist_wheel') | ||
|
||
|
||
package_data = [] | ||
|
||
old_dir = os.getcwd() | ||
|
||
os.chdir('tracker') | ||
|
||
for path in ['templates', 'static', 'locale', 'fixtures']: | ||
for root, dirs, files in os.walk(path): | ||
for f in files: | ||
package_data.append(os.path.join(root, f)) | ||
def get_package_name(name): | ||
if not PACKAGE_NAME_SUFFIX: | ||
return name | ||
return f'{name}-{PACKAGE_NAME_SUFFIX}' | ||
|
||
os.chdir(old_dir) | ||
|
||
setup( | ||
name='django-donation-tracker', | ||
name=get_package_name('django-donation-tracker'), | ||
version='3.1', | ||
author='Games Done Quick', | ||
author_email='[email protected]', | ||
|
@@ -46,7 +41,9 @@ def run(self): | |
description='A Django app to assist in tracking donations for live broadcast events.', | ||
long_description=open('README.md').read(), | ||
zip_safe=False, | ||
package_data={'': ['README.md'], 'tracker': package_data}, | ||
# Included files are defined in MANIFEST.in, which will be automatically | ||
# picked up by setuptools. | ||
include_package_data=True, | ||
cmdclass={ | ||
'package': PackageCommand, | ||
}, | ||
|