Warning This repository has been deprecated in favor of ansys-templates. The new template takes advantage of a dynamic install, allows you to select the build system and is deeply tested.
Easily create a new Python project with simple commands:
pipx run ansys-create-python-project -n my-project
or
acpp -n my-project
The new python project will be created according to the Ansys-recommended structure.
For example, the commands above will create a directory called my-project
inside the current directory.
View the full documentation here.
- Python 3.8+
- pip
- pipx (Optional but recommended)
This tool is compatible with Windows OS and Linux distributions.
pipx run ansys-create-python-project -n my-project
pipx is a package runner tool that that helps to run applications written in Python. In fact, it uses pip, but is focused on installing and managing Python packages that can be run from the command line directly as applications. pipx requires Python 3.6+ and can be installed by following these instructions.
It will create a directory called my-project
inside the current folder.
Inside that directory, it will generate the initial project structure and install
the transitive dependencies:
my-project
├── README.md
├── CONTRIBUTING.md
├── LICENSE
├── flake8
├── pytest.ini
├── requirements.txt
├── package.json
├── CHANGELOG.md
├── .gitignore
├── .gitattributes
├── docker
│ ├── dockerfile
│ └── docker-compose.yml
├── doc
│ ├── images
│ | └── img.jpeg
│ └── README.md
├── src
│ └── app.py
├── tests
│ └── test_app.py
└── examples
└── README.md
No configuration or complicated folder structures required, only the files you need to build your app.
If you do not want to install pipx you can still use the package, but first you must install it with pip.
pip install ansys-create-python-project
Then, you can run the package on the command line.
acpp -n my-project
If you aren't sure what sort of arguments you need to supply you can always view the help through the following command.
acpp --help
The default project template is 'classic'. However, there are several other templates available. You can view the available templates by running the following command.
pipx run ansys-create-python-project --template
You can easily specify other templates with the -t
flag.
pipx run ansys-create-python-project -n my-project -t rest-api
The project newly created is done with a docker and a docker-compose files in the /tests
folder. That enables to run
all tests very easily in any environment without any additional requirements (only docker
and docker-compose are required).
To run the tests run the following command:
- Move to /tests folder
- Build the docker image
- Start a container
- Run the tests
- Optional: Run specific tests suites thanks to the powerful pytest search feature
1- Go inside the created directory by running
cd ./my-project
2- Push this project in git remote repository"
git init
git remote add origin <git_repository_url>
git add . && git commit -m \"initial commit\"
git push origin main