Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new generated content #46

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ build/**
dist/**
src/PythonProjectBootstrapper.egg-info/**

key.pri
key.pub
minisign_key.pri
minisign_key.pub
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Tool that helps in the creation of python projects.
- Wheel deployment to [PyPi](https://pypi.org)
- Executable generation via [cx_Freeze](https://marcelotduarte.github.io/cx_Freeze/)
- Full [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration), [Continuous Delivery](https://en.wikipedia.org/wiki/Continuous_delivery), and [Continuous Deployment](https://en.wikipedia.org/wiki/Continuous_deployment) (via [GitHub Actions](https://github.com/features/actions)) for everything listed above
- GitHub [Recommended Community Standards](https://opensource.guide/) documentation
- GitHub [pull request template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository)
- GitHub [issue templates](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository)
- [Optional] Build artifact signing via [Minisign](https://jedisct1.github.io/minisign/)
- [Optional] Participation in the [Open Source Security Foundation (OpenSSF) Best Practices Badge Program](https://www.bestpractices.dev/)
- [Optional] Generation of development environment [docker](https://www.docker.com/) [images](https://aws.amazon.com/compare/the-difference-between-docker-images-and-containers/) in support of [FAIR principles](https://www.go-fair.org/fair-principles/)
Expand Down Expand Up @@ -161,6 +164,7 @@ There are other tools available that offer similar functionality, each emphasizi
| [LINCC Frameworks Python Project Template](https://github.com/lincc-frameworks/python-project-template) | This project template codifies LINCC-Framework's best practices for python code organization, testing, documentation, and automation. |
| [Cookiecutter Django](https://github.com/cookiecutter/cookiecutter-django) | Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly. |
| [cookiecutter-pylibrary](https://github.com/ionelmc/cookiecutter-pylibrary) | Enhanced cookiecutter template for Python libraries. |
| [repo-scaffolder](https://github.com/DSACMS/repo-scaffolder) | Templates and commandline tools for creating repositories for US Federal open source projects |

### Templating Systems

Expand Down
2 changes: 1 addition & 1 deletion src/PythonProjectBootstrapper/ProjectGenerationUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def CopyToOutputDir(
and current_file_hash == existing_manifest[rel_filepath]
):
modified_template_files.append(output_dir_filepath.as_posix())
elif potential_manifest.is_file():
elif rel_filepath in existing_manifest:
# If here, the file no longer exists. We still want the file to exist in the manifest
# (so that future generations are still aware of it), but do not want it to be created
# again.
Expand Down
2 changes: 1 addition & 1 deletion src/PythonProjectBootstrapper/package/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"pypi_project_name": "\n\nPlease enter the name of your project as it will appear on PyPI (https://pypi.org). This name cannot be associated with any other project on PyPI.\n\n",
"gist_id": "\n\nPlease enter the GitHub gist id for use with this project.\n\nGitHub defines a gist as \"a simple way to share snippets and pastes with others.\" The generated python project will use a gist to store information dynamically generated during the build (for example code coverage information) that can be retrieved at a later time (for example, to display a code coverage badge in the project's README.md file). To create a gist:\n 1. Go to https://gist.github.com/\n 2. Enter the following values in their respective fields:\n\n Gist description...: Gist used by GitHub Action workflows to store and retrieve dynamic information (oftentimes used to create and display badges).\n Filename including extension...: README.md\n File contents: Gist used by GitHub Action workflows to store and retrieve dynamic information (oftentimes used to create and display badges).\n\n 3. Click the \"Create secret gist\" button\n 4. Copy the gist id (this will be the hex string at the end of the url associated with the gist\n that was just created). It will look something like:\n\n https://gist.github.com/<github username>/4c10281ff1abc26cafcb9a5f9a8a443e\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n This is the gist id\n\n",
"gist_username": "\n\nPlease enter the username associated with your gist_id. In most cases, this will be the same as your GitHub username.\n\n",
"minisign_public_key": "\n\nPlease enter your Minisign public key for use with this project or \"none\" if you do not want to sign binaries (this is not recommended).\n\nMinisign is a dead simple tool to sign files and verify signatures. It is a secure tool that uses the Ed25519 public-key signature system. More information is available at https://jedisct1.github.io/minisign/.\n\nNote that these steps rely on docker (docker.com), so please make sure that docker is installed and working properly on your machine.\nAdditional information is available at https://docs.docker.com/engine/install/.\n\nTo create a Minisign key pair for use with this project:\n 1. Run 'docker run -i --rm -v \".:/host\" jedisct1/minisign -G -p /host/key.pub -s /host/key.pri -W'\n 2. Ensure that the file 'key.pri' exists (this file will be used later).\n 3. Open the file 'key.pub' and copy the key from the file; the key will be the last line of the file.\n 4. Paste the copied key here.\n\n",
"minisign_public_key": "\n\nPlease enter your Minisign public key for use with this project or \"none\" if you do not want to sign binaries (this is not recommended).\n\nMinisign is a dead simple tool to sign files and verify signatures. It is a secure tool that uses the Ed25519 public-key signature system. More information is available at https://jedisct1.github.io/minisign/.\n\nNote that these steps rely on docker (docker.com), so please make sure that docker is installed and working properly on your machine.\nAdditional information is available at https://docs.docker.com/engine/install/.\n\nTo create a Minisign key pair for use with this project:\n 1. Run 'docker run -i --rm -v \".:/host\" jedisct1/minisign -G -p /host/minisign_key.pub -s /host/minisign_key.pri -W'\n 2. Ensure that the file 'minisign_key.pri' exists (this file will be used later).\n 3. Open the file 'minisign_key.pub' and copy the key from the file; the key will be the last line of the file.\n 4. Paste the copied key here.\n\n",
"openssf_best_practices_badge_id": "\n\nPlease enter your OpenSSF Best Practices Badge id for use with this project or \"none\" if you do not want to display this badge. Visit https://www.bestpractices.dev/ for additional information about this badge.\n\nTo create a OpenSSF Best Practices Badge id for use with this project:\n 1. Visit https://www.bestpractices.dev/\n 2. Click the \"Get Your Badge Now!\" button.\n 3. In the top form, select the corresponding repository.\n 4. Click the \"Submit GitHub Repository\" button.\n 5. Copy the badge id from the URL of the page that is displayed. It will look something like:\n\n https://www.bestpractices.dev/en/projects/12345\n ^^^^^\n This is the badge id\n\n",
"create_docker_image": "\n\nWould you like the GitHub Action workflows to create docker images of the development environment? These images can be used to produce exact results across different commits made to the repository over time (which is especially valuable when writing scientific software).\n\n"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ minisign_public_key: |-
Additional information is available at https://docs.docker.com/engine/install/.

To create a Minisign key pair for use with this project:
1. Run 'docker run -i --rm -v ".:/host" jedisct1/minisign -G -p /host/key.pub -s /host/key.pri -W'
2. Ensure that the file 'key.pri' exists (this file will be used later).
3. Open the file 'key.pub' and copy the key from the file; the key will be the last line of the file.
1. Run 'docker run -i --rm -v ".:/host" jedisct1/minisign -G -p /host/minisign_key.pub -s /host/minisign_key.pri -W'
2. Ensure that the file 'minisign_key.pri' exists (this file will be used later).
3. Open the file 'minisign_key.pub' and copy the key from the file; the key will be the last line of the file.
4. Paste the copied key here.

openssf_best_practices_badge_id: |-
Expand Down
22 changes: 11 additions & 11 deletions src/PythonProjectBootstrapper/package/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ def SavePrompts() -> None:
f"""\
In this step, we will save the Minisign private key as a GitHub Action Secret.

1. Open 'key.pri' in a text editor.
1. Open 'minisign_key.pri' in a text editor.
2. Copy the contents of the file.
3. Visit {{ cookiecutter.github_url }}/{{ cookiecutter.github_username }}/{{ cookiecutter.github_project_name }}/settings/secrets/actions
4. In the "Repository secrets" section...
5. Click the "New repository secret" button
6. Enter the values:
Name: MINISIGN_PRIVATE_KEY
Secret: <paste the contents of key.pri copied in step #2>
Secret: <paste the contents of minisign_key.pri copied in step #2>
7. Click the "Save" button
8. Save 'key.pri' in a safe place.
8. Save 'minisign_key.pri' in a safe place.
""",
)
{% endif %}
Expand Down Expand Up @@ -315,15 +315,15 @@ def SavePrompts() -> None:

{% endif %}

prompts["Update README.md"] = textwrap.dedent(
"""\
In this step, we will update the README.md file with information about your project.
for filename in ["README.md", "MAINTAINERS.md"]:
prompts[f"Update {filename}"] = textwrap.dedent(
f"""\
In this step, we will update the {filename} file with information about your project.

1. Edit README.md
2. Replace the "TODO" comment in the "Overview" section.
3. Replace the "TODO" comment in the "How to use {{ cookiecutter.github_project_name }}" section.
""",
)
1. Edit {filename}
2. Replace the "TODO" comments in the file.
""",
)

with open(prompt_filename, "w") as prompt_file:
# Modify the keys to include an index to ensure that the prompts are displayed in the
Expand Down
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @{{cookiecutter.github_username}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve.
title: ''
labels: ''
assignees: ''

---

## Describe the bug
A clear and concise description of what the bug is.

## To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Expected behavior
A clear and concise description of what you expected to happen.

## Screenshots
If applicable, add screenshots to help explain your problem.

## Environment (please complete the following information):
- OS: [e.g. iOS]
- Python Version: [e.g. 3.12, 3.11, etc.]
- {{ cookiecutter.pypi_project_name }} Version [e.g. 1.2.3]

## Additional context
Add any other context about the problem here.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Custom issue template
about: Create an issue that isn't a bug or feature request.
title: ''
labels: ''
assignees: ''

---
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this {{ cookiecutter.github_project_name }}.
title: ''
labels: ''
assignees: ''

---

## Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

## Describe the solution you'd like
A clear and concise description of what you want to happen.

## Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

## Additional context
Add any other context or screenshots about the feature request here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## :pencil: Description
Please include a summary of the change and the work item associated with it.

## :gear: Work Item
Please include link to the corresponding GitHub Issue or Project work item.

## :movie_camera: Demo
Please provide any images, GIFs, or videos that show the effect of your changes (if applicable). A picture is worth a thousand words.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ build/**
dist/**
src/{{ cookiecutter.pypi_project_name }}.egg-info/**

key.pri
key.pub
minisign_key.pri
minisign_key.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# {{ cookiecutter.github_project_name }} Open Source Code of Conduct

## Principles
These principles guide our data, product, and process decisions, architecture, and approach.

- Open means transparent and participatory.
- We take a modular and modern approach to software development.
- We build open-source software and open-source process.
- We value ease of implementation.
- Fostering community includes building capacity and making our software and processes accessible to participants with diverse backgrounds and skillsets.
- Data (and data science) is as important as software and process. We build open data sets where possible.
- We strive for transparency for algorithms and places we might be introducing bias.

## Community Guidelines
Information on contributing to this repository is available in our [Contributing file](CONTRIBUTING.md).

When participating in {{ cookiecutter.github_project_name }} open source community conversations and spaces, we ask individuals to follow the following guidelines:

- Embrace a culture of learning, and educate each other. We are all entering this conversation from different starting points and with different backgrounds. There are no dumb questions.
- Take space and give space. We strive to create an equitable environment in which all are welcome and able to participate. We hope individuals feel comfortable voicing their opinions and providing contributions and will do our best to recognize and make space for individuals who may be struggling to find space here. Likewise, we expect individuals to recognize when they are taking up significant space and take a step back to allow room for others.
- Be respectful.
- Default to positive. Assume others' contributions are legitimate and valuable and that they are made with good intention.

## Acknowledgements
This Community Guidelines was adapted from the [United States Digital Service](https://usds.gov) [Justice40](https://thejustice40.com) open source [repository](https://github.com/usds/justice40-tool).
Loading